Undefined Array Keys when Defaults are missing

Created on 4 December 2024, 2 months ago

Problem/Motivation

For reasons I cannot explain, it appears that most of my views no longer presented default values for several fields being referenced in the ViewsEFFieldset.php file. This could be a result of a recent update to Core or PHP, but I cannot pinpoint when the issue began. I came across the issue when attempting to setup a new view. Several errors like this one appeared my console log when attempting to configure the exposed for style settings:

Warning:  Undefined array key "options" in /var/www/html/docroot/modules/contrib/views_ef_fieldset/src/Plugin/views/display_extender/ViewsEFFieldset.php on line 194
Warning:  Trying to access array offset on null in /var/www/html/docroot/modules/contrib/views_ef_fieldset/src/Plugin/views/display_extender/ViewsEFFieldset.php on line 194

These prevented the settings window from opening.

Proposed resolution

Adding some basic checks that provide a default value when the key missing seems to solve the problem.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024