Undefined index for role that was not configure

Created on 10 February 2020, almost 5 years ago
Updated 20 July 2023, over 1 year ago

Problem/Motivation

In hook_node_grants() the configuration for roles is read and foreach role that exists in the system, an entry is written to the $grants array. The code does not check whether configuration exists for any given role. We've seen this run into problems on our automated tests, where configuration does not exist for a role.

Proposed resolution

Do an isset() check before trying to assign a value from the configuration.

Remaining tasks

  • Create patch
  • Review
  • Commit

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands eelkeblok Netherlands 🇳🇱

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.

Production build 0.71.5 2024