Exception: Warning: Undefined array key "#other_option"

Created on 2 July 2025, 4 days ago

Problem/Motivation

When running a custom Functional Test which uses this module.
Exception: Warning: Undefined array key "#other_option" Drupal\select_or_other\Element\ElementBase::addSelectField()() (Line: 141) is thrown

This is because $element['#other_option'] could be undefined.

Steps to reproduce

Proposed resolution

Use nullsafety check $element['#other_option'] ?? ''

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.2

Component

Code

Created by

🇨🇳China skyredwang Shanghai

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

Comments & Activities

Production build 0.71.5 2024