User reference grants not saving

Created on 23 November 2015, almost 10 years ago
Updated 25 September 2025, 11 days ago

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.

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024