I have a checkbox field that records whether or not a user has met a certain criteria, and I want to create a listing of all the users for which that field is unchecked. The problem is that when they don't check the field, no record at all is created to represent that field in profile_values. Then, when the views.module attempts to retrieve that field, it shows the undefined values as being *checked*, even though it was submitted as unchecked. On top of that, the usernode.module doesn't show these fields at all -- not even blank-- when displaying the user, (eg. for page 'user/18'), even though it *does* show them if you click on the edit tab (ie. 'user/18/edit')
This problem goes away if the user checks the field and submits their user-profile (thus creating the row to represent the field), and then unchecks the field and resubmits the form (leaving the row intact, but setting its value to '0', as it should have been from the start.)
Is there something I'm missing here? This seems like a bug to me.
I think I can fix it with a call to hook_user(), to add empty rows. But I think the module should be taking care of this itself. (And I'll post this patch if I go ahead with it.)
Any pointers?
Thanks,
Dan
Comments
Comment #1
dan3h commentedGot a solution. First of all, I think this is a bug for the profile module, not usernode. If someone knows how to switch this issue to be on profile (a core module), please switch it-- I don't see any core modules in the list.
Basically, all this fix does is insert blank values upon user insert/update where they are missing. Really, this should not be in "mymodule", but in profile.module.
Comment #2
fagousernode doesn't show core profile module fields.
Comment #3
pomliane commentedThis version of Usernode is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.