Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
the 'Blocked' checkbox under the "User status that can be referenced" field setting does not take.
That's most probably because the associated value is 0.
There was a long standing core issue about that, and I thought this was finally fixed. I can't seem to find it right now, though...
Comment | File | Size | Author |
---|---|---|---|
#7 | references_allow_referencing_blocked_users-1038102-7.patch | 614 bytes | dtarc |
Comments
Comment #1
andypostConfirm this. as I remember there was 2-3 issues with '0' values of radios checkboxes but all been fixed in core...
suppose issue related to current implementation...
Comment #2
fgmReplaced the use of 0 and 1 by string values to avoid falling in this type of bug.
Comment #3
fgmAs possibly faster solution was suggested by dereine, using a '-0' option instead of '0' and fixing up the value in submit. Then there is no need for the conversion loop in the suggested patch.
And, of course, we need a test to validate the changes.
Comment #4
yched CreditAttribution: yched commentedAgreed, I'd favor a workaround strictly contained within FAPI processing, without changing the semantics of the stored values.
Also (minor) : if both checkboxes are checked, no need to add anything to the query.
Comment #5
rt_davies CreditAttribution: rt_davies commentedsubscribe
Comment #6
bocaj CreditAttribution: bocaj commentedChanging line 91 in user_reference.module from:
to:
worked for me. Not sure that it's the best way to handle it, but now it functions like I expected!
Comment #7
dtarc CreditAttribution: dtarc commentedThe suggestion in #6 worked for me, here's a patch.
Comment #8
andypostI think using '-0' should have
(int)
inComment #9
alanburke CreditAttribution: alanburke commentedI don't think this matters anymore - I don't seem to have the issue in any case
Comment #10
presleyd CreditAttribution: presleyd commentedProblem still exists in 2.1 perhaps it was fixed in dev? Patch in 7 still works in 2.1 though.
Comment #11
MantasK CreditAttribution: MantasK commentedas it is not fixed, one more patch :)
Comment #13
fullerja CreditAttribution: fullerja commentedPatch in #7 worked well for me