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.
When you update the node which contains the user_reference field, you receive an error message if you leave the field blank.
If the field is empty then foreach loop will not create any element in the array $form_values['uid']. So count() gets a non-existing array.
This patch declares the $form_values['uid'] as an empty array before foreach loop.
Comment | File | Size | Author |
---|---|---|---|
#6 | access-7.x-1.x-dev-undefined-index-uid-2410067-6.patch | 584 bytes | luenemann |
| |||
#3 | access-7.x-1.x-dev-undefined-index-uid.patch | 584 bytes | adci_contributor |
after.png | 12.71 KB | adci_contributor | |
before.png | 25.2 KB | adci_contributor |
Comments
Comment #1
vlad.pavlovic CreditAttribution: vlad.pavlovic commentedPlease re-roll this patch against dev version.
Comment #2
vlad.pavlovic CreditAttribution: vlad.pavlovic commentedComment #3
adci_contributor CreditAttribution: adci_contributor commentedRerolled :)
Comment #4
joelpittetStill applies, thanks @adci_contributor
Comment #5
joelpittetbump
Comment #6
luenemannreroll of #2410067-3: Undefined index 'uid' in nodeaccess_insert_user_reference(). moved the fix from
nodeaccess_insert_user_reference()
to
nodeaccess_delete_user_reference()
Rerolled
Comment #7
luenemannComment #8
LeDucDuBleuet CreditAttribution: LeDucDuBleuet as a volunteer commentedThis issue is fixed as well with the patch I submitted in : #2099871 User reference case wont work.
Since the other issue goes at the root of the problem for User Reference permissions, I propose we close this one as outdated and work on the other.
Thank you.