Warning: Undefined key for 'role name'

Created on 20 March 2023, over 1 year ago
Updated 2 March 2024, 4 months ago

Problem/Motivation

Clean code should not produce warnings.

Steps to reproduce

Create a few custom roles and install the openid_connect module. Opening the configuration form without any existing configuration present will show a warning for each custom role.

Proposed resolution

Check for existence of an array key before doing the is_array check.

Old code

if (($role_mappings[$role_id])) {

New code

if (isset($role_mappings[$role_id]) && ($role_mappings[$role_id])) {

Remaining tasks

- Provide patch
- Review by Community

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands ericmulder1980

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

Comments & Activities

Production build 0.69.0 2024