Problem/Motivation

### Problem/Motivation

The hook multiple_registration_entity_form_display_alter() dereferences $config[$rid] without checking that it exists, in both switch branches:

  $custom_form_mode = $config[$rid]['form_mode_register'] ?: 'register';
  $custom_form_mode = $rid ? $config[$rid]['form_mode_edit'] : 'default';

Each unconfigured $rid logs two warnings per request:

  Undefined array key "<rid>"
  Trying to access array offset on value of type null

This was fixed for the register branch in #3383084 (e88d0089), but the config read was later flattened from $config->get('roles')[$rid] to $config[$rid], and that rewrite reinstated ?: and lost the guard.

Steps to reproduce

1. Log in.
2. Request /user/register/.
3. Check /admin/reports/dblog: two warnings per request.

Proposed resolution

Restore the guards so the computed values are unchanged.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alex.bukach created an issue. See original summary.

alex.bukach’s picture

Assigned: alex.bukach » Unassigned
Status: Active » Needs review