Fatal error on Drupal 11 if an exposed views filter has option "reduce"

Created on 30 April 2025, 3 days ago

Problem/Motivation

"workflow_state" views filter causes fatal error if enable option «Limit list to selected items».
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 276 of core/modules/views/src/Plugin/views/filter/InOperator.php).

Steps to reproduce

  1. Install Drupal 11 (I tested on 11.1.6 )
  2. Install and configure Workflow module (I used 2.0.0)
  3. Add a workflow field for any content type (e.g. Article).
  4. Create page views on this content type.
  5. Add exposed filter for the created workflow field.
  6. Check option «Limit list to selected items» for the created filter.
  7. Open the views page and see the error.

Proposed resolution

Remaining tasks

No

User interface changes

No

API changes

No

Data model changes

No

🐛 Bug report
Status

Active

Version

2.0

Component

Views

Created by

🇷🇺Russia Alezu

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

Comments & Activities

  • Issue created by @Alezu
  • @alezu opened merge request.
  • 🇷🇺Russia Alezu

    I've fixed the error locally by converting views filter options labels to string. Please review.

Production build 0.71.5 2024