Undefined array key warnings in ctools_views for views block with exposed field and operator

Created on 14 January 2025, 3 months ago

Problem/Motivation

PHP warnings in Drupal's log when placing a view block with an exposed filter that has its operator exposed.
Warning: Undefined array key "{$FILTER_NAME}" in Drupal\ctools_views\Plugin\Display\Block->blockValidate() (line 444 of /app/web/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php)

Steps to reproduce

  1. Create a view with a block display.
  2. In Block settings, Allow settings, check "Configure filters".
  3. Add an exposed filter and check "Expose operator".
  4. Save the view.
  5. on the Block layout page, add the view block to a region.
  6. Save the block: the error will be logged.

Proposed resolution

Check for an exposed operator by looking for "_wrapper" in the array key. This mirrors code in the blockSubmit() method.

Remaining tasks

n/a

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ› Bug report
Status

Active

Version

4.1

Component

CTools Views

Created by

πŸ‡ΊπŸ‡ΈUnited States apkwilson

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