Undefined array key label and description with exposed filter

Created on 30 January 2025, 6 days ago

Problem/Motivation

There are warnings if the views filter is exposed (Expose operator checkbox is checked on the filter's config).
Warning: Undefined array key "label" in Drupal\views_ef_fieldset\ViewsEFFieldsetData->moveFormElement() (line 151 of modules/contrib/views_ef_fieldset/src/ViewsEFFieldsetData.php).
Warning: Undefined array key "description" in Drupal\views_ef_fieldset\ViewsEFFieldsetData->moveFormElement() (line 152 of modules/contrib/views_ef_fieldset/src/ViewsEFFieldsetData.php).

Steps to reproduce

Enable Expose operator for a views filter

Proposed resolution

Check array index existence $form_info['label'] and $form_info['description']

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇭🇺Hungary peter_serfozo

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

Merge Requests

Comments & Activities

  • Issue created by @peter_serfozo
  • First commit to issue fork.
  • Merge request !24Fix undefined array key warning → (Open) created by roderik
  • Pipeline finished with Success
    5 days ago
    Total: 216s
    #411101
  • 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU

    Reviewed:

    Saw it in action, but also: this patch looks good from just code inspection, without side effects:

    • There doesn't seem to be a reason that $form_info['label'] needs to be converted from [empty value] to "". (It turned "0" into "" before, but I think we don't care.)

    Created a MR for the gitlab. I hope I can still change from implicit-Needs-Review to RTBC. (The only doublecheck to be done is, did I change anything from patch to MR contents.)

Production build 0.71.5 2024