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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vlad.pavlovic’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

Please re-roll this patch against dev version.

vlad.pavlovic’s picture

Status: Active » Needs review
adci_contributor’s picture

FileSize
584 bytes

Rerolled :)

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Still applies, thanks @adci_contributor

joelpittet’s picture

bump

luenemann’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
584 bytes

reroll 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

luenemann’s picture

LeDucDuBleuet’s picture

Status: Needs review » Closed (outdated)
Related issues: +#2099871: User reference case wont work.

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