EPSCoR / ERCore

ERcore content management system to assist with NSF EPSCoR reporting
4 stars 7 forks source link

in user's Demographic is N/A option shown? #64

Closed khuffman closed 7 years ago

khuffman commented 7 years ago

A question: in your jurisdiction's ERCore, when you go into a user's profile, in Edit form under the Demographic tab, is the N/A option shown for the various radio buttons? like here, for example see here: http://dev-ercore.nmepscor.net/user/13/edit Or did you do something specific to hide the N/A option?

khuffman commented 7 years ago

I know in form_logic.inc there this this function, _remove_NA_option($form, &$form_state) that gets called for various form items, but I wonder why this _remove_NA_option() function is not being used for the Demographic items? was there a reason for it?

aturling commented 7 years ago

I left "N/A" under Gender and Ethnicity as sort of a "prefer not to respond" option. I hid it for Disabilities (which already has "none" as an option) and Race (which already has a "prefer not to respond" option). I did this + other user profile customizations in a custom module to avoid changing the ER Core code.

ercore commented 7 years ago

In NM we left the N/A and I have no idea why they were left in. Though, I did find this note about the N/A option on the old Trello Board, note is from @cjallen-epscor on 1/14/2014!

Without setting the field to "required" the "N/A" option will appear. I did add the option of "Prefer not to respond". According to http://drupal.stackexchange.com/questions/38032/widget-type-radio-buttons-and-n-a "N/A is implemented that way, because otherwise users don't have any way to deselect a radio button, and for some (government) sites that's a requirement. To change it use: - a form_alter in a custom module

  • javascript inside your theme to hide the N/A option.
  • theme_options_none I think showing the n/a field is not a problem. Ethnicity, disability, and other Demographic fields have this as well.

Kia, if you still have access to the trello board here's the direct link to the card, https://trello.com/c/AEcWrWFz

Thanks! Isis

khuffman commented 7 years ago

@ercore thank you very much for finding this old Trello note. OK, now I understand better the reasoning behind why the N/A is by purpose not hidden for some fields(such as gender etc) but is hidden by purpose for other fields (field_er_faculty_any_support). Thanks!

cjallen-epscor commented 7 years ago

@khuffman - yeah basically if a field is not marked as required (gender/race/etc) then by default Drupal adds a "N/A". As mentioned in my card from 2014 "N/A is implemented that way, because otherwise users don't have any way to deselect a radio button, and for some (government) sites that's a requirement."

Easy way would be to hide via states in form_logic.inc

ercore commented 7 years ago

@khuffman did you resolve this issue/question on your site?

khuffman commented 7 years ago

Yes, it is resolved, thanks.

On 01/05/2017 02:34 PM, NM EPSCoR Reporting wrote:

@khuffman https://github.com/khuffman did you resolve this issue/question on your site?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EPSCoR/ERCore/issues/64#issuecomment-270735823, or mute the thread https://github.com/notifications/unsubscribe-auth/AH7MkofFrZAEWS2w2fP_wf8y43uSeKpyks5rPUW4gaJpZM4KRSqH.