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

Created on 16 May 2024, 7 months ago
Updated 25 June 2024, 6 months ago

Problem/Motivation

Found several warnings in the views block with exposed field filter:

1. Grouped exposed filter.

Warning: Undefined array key "group_info" in Drupal\ctools_views\Plugin\Display\Block->mapConfigToHandler() (line 837 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php). 
Warning: Trying to access array offset on value of type null in Drupal\ctools_views\Plugin\Display\Block->mapConfigToHandler() (line 837 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php).

Steps to reproduce:

  1. Create a view with block display.
  2. In the Block settings => Allow settings check "Configure filters"
  3. In the views Filter criteria add exposed filter, but with Grouped values.
  4. Insert views block to the page (I used layout builder).

2. Single exposed filter with multiple options.

Warning: Undefined array key "value" in Drupal\ctools_views\Plugin\Display\Block->blockForm() (line 311 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php).
Warning: Undefined array key "value" in Drupal\ctools_views\Plugin\Display\Block->mapConfigToHandler() (line 850 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php).
Warning: Undefined array key "value" in Drupal\ctools_views\Plugin\Display\Block->mapConfigToHandler() (line 853 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php).
Warning: Undefined array key "value" in Drupal\ctools_views\Plugin\Display\Block->mapConfigToHandler() (line 857 of /var/www/docroot/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php).

Steps to reproduce:
Same as above, but select Single filter type and check "Allow multiple selections" for the exposed filter.

Proposed resolution

Created MR and patch to fix warnings.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

CTools Views

Created by

πŸ‡ΊπŸ‡¦Ukraine vselivanov Kyiv, Ukraine

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