Problem/Motivation

While debugging this notice:

Notice: Undefined index: uid in nodeaccess_insert_user_reference() (line 937 of nodeaccess/nodeaccess.module).

I realized the values from field_get_items()
return in this format:

$user_uids = [
  '0' => ['uid' => 12345],
  '1' => ['uid' => 12346],
]

and user_load_multiple()
expects them to be:

$user_uids = [
  '0' => 12345,
  '1' => 12346,
]

Proposed resolution

Flatten the multidimentional field array.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

joelpittet’s picture

Status: Active » Needs review