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 checkbox in the widget settings doesn't keep nor does the autcomplete include blocked users.
Perhaps due the fact the value for blocked is 0 and there's any array filter around line 75 and around 792 that completely strips the "yo man, blocked's okay" from the the referenceable_status setting.
Sorry if this is a repeat issue
Comment | File | Size | Author |
---|---|---|---|
#9 | userreference-416134-9.patch | 3.83 KB | markus_petrux |
Comments
Comment #1
petrescs CreditAttribution: petrescs commentedsubscribing - checking Blocked status box is not saved, only the default marked Active checkbox is preserved
Comment #2
aharown07 CreditAttribution: aharown07 commentedAlso having this problem. We would like very much to be able to reference blocked users when we write our user histories. Anybody got patch ideas? Beyond my skills unfortunately.
Comment #3
aharown07 CreditAttribution: aharown07 commentedWorkaround: if you have Views, a View that includes both blocked and unblocked does work as the source for the user ref field... just make the View then choose it under Advanced.
Still a bug though since there's a checkbox there that doesn't work.
Comment #4
hefox CreditAttribution: hefox commentedAn easy but wonky way:
1) make a a define('BLOCKED_USER_VALUE',2) or maybe 'blocked'.
2) in the form have BLOCKED_USER_VALUE instead of 0 as the key
3) Replace BLOCKED_USER_VALUE with 0 for DB call.
(Don't have the code in front of me so no line numbers. but using above step 2 was probably line 75 and step 3 was probably line 792).
Comment #5
ize CreditAttribution: ize commentedsubscribe
Comment #6
markus_petrux CreditAttribution: markus_petrux commentedProbably the user status option would have to be converted into a 'radios' element with the following options:
To do so, we need to change a little the code in userreference.module, but also implement a new hook_update_N() function to migrate the field settings to the new format (from array() to integer).
If Active or Blocked has been selected can be checked using is_numeric().
Comment #7
DarrellDuane CreditAttribution: DarrellDuane commentedalso having this problem, subscribe. I'd like to import legacy data that references blocked users and node import is blocking me from doing this.
Comment #8
DarrellDuane CreditAttribution: DarrellDuane commentedAs a workaround for this issue, I exported the CCK definition, searched for the UID field and edited the section referenceable_status so that it appears as below (I changed 0 => 0, to be 0 => 1).
I then deleted the CCK type and imported the edited definition. This User Reference field now accepts both blocked and unblocked users.
'referenceable_status' =>
array (
1 => 1,
0 => 1,
),
Comment #9
markus_petrux CreditAttribution: markus_petrux commentedAttached patch proceeds as described in #6. Requires running update.php
Please test and let me know if this approach worked. Thanks
Comment #10
markus_petrux CreditAttribution: markus_petrux commentedBetter title. :P
Comment #11
markus_petrux CreditAttribution: markus_petrux commentedCommitted the patch in #9 to CVS (branches CCK2 and CCK3).