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.
I had to make a couple of patches to user_reference.module:
user_reference_potential_references:
if (module_exists('views') && !empty($field['settings']['view']['view_name'])) {
if($field['settings']['view']['view_name']!='--'){ // added
$references = _user_reference_potential_references_views($field, $options);
} // added
}
_user_reference_potential_references_standard:
$filter_status = array(); // added
if(count($filter_status)>0){ // added
$filter_status = array_filter($field['settings']['referenceable_status']);
} // added
Comment | File | Size | Author |
---|---|---|---|
#4 | references.20150827_fix_referenceable_status_1462976_04.patch | 986 bytes | rfay |
Comments
Comment #1
StephenRobinson CreditAttribution: StephenRobinson commentedooops got this a bit wrong
Comment #2
jbeall CreditAttribution: jbeall commentedHi SangersDrupalDude,
I encountered what I think is the issue you're describing, but the only change that was necessary was to add the code you gave for the _user_reference_potential_references_standard function, and I added it in place of $filter_status = array_filter($field['settings']['referenceable_status']); (which was line 864 for me).
Since I did this I haven't noticed a recurrence of the issue I was encountering.
What is the code you posted for user_reference_potential_references intended to address? And where in the user_reference_potential_references function did you place your code?
-Josh
Comment #3
manoloka CreditAttribution: manoloka commentedCan you please provide a proper patch for this?
Thanks
Comment #4
rfayHere's the patch. I don't know whether this affects only upgraded sites or not, but referenceable_status can certainly be a boolean even on a new node.
Comment #5
renatogHi people.
Thank you very much for contribution.
Make sense.
Comment #7
renatogFixed.
Commited in dev branch.
Regards.