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...

Files: 
CommentFileSizeAuthor
#11 references_allow_referencing_blocked_users-1038102-11.patch1.06 KBMantasK
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch references_allow_referencing_blocked_users-1038102-11_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#7 references_allow_referencing_blocked_users-1038102-7.patch614 bytesdtarc
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
#2 user_reference_1038102.patch1.78 KBfgm
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

Confirm 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...

Status:Active» Needs review
StatusFileSize
new1.78 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Replaced the use of 0 and 1 by string values to avoid falling in this type of bug.

Status:Needs review» Needs work

As 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.

Agreed, 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.

subscribe

Changing line 91 in user_reference.module from:

'#options' => array(1 => t('Active'), 0 => t('Blocked')),

to:

'#options' => array(1 => t('Active'), '-0' => t('Blocked')),

worked for me. Not sure that it's the best way to handle it, but now it functions like I expected!

Status:Needs work» Needs review
StatusFileSize
new614 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

The suggestion in #6 worked for me, here's a patch.

I think using '-0' should have (int) in

<?php
- $query->condition('u.status', $field['settings']['referenceable_status']);
+
$query->condition('u.status', (int) $field['settings']['referenceable_status']);
?>

I don't think this matters anymore - I don't seem to have the issue in any case

Problem still exists in 2.1 perhaps it was fixed in dev? Patch in 7 still works in 2.1 though.

Issue summary:View changes
StatusFileSize
new1.06 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch references_allow_referencing_blocked_users-1038102-11_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

as it is not fixed, one more patch :)

Status:Needs review» Needs work

The last submitted patch, 11: references_allow_referencing_blocked_users-1038102-11.patch, failed testing.