Views exposed grouped date filter default value

Created on 8 May 2025, 3 months ago

Steps to reproduce

Use the same steps to reproduce as in πŸ› Warning: Undefined array key "type" in Drupal\views\Plugin\views\filter\Date->acceptExposedInput() Needs work , but make the field required (not optional), and select one of the grouped options as default value.

You'll get the warning:

The submitted value in the my-filter-name element is not allowed.

Proposed resolution

This is caused in FilterPluginBase, which expects $this->group_info to always contain the default value. When the filter is build on a date (range) field (and probably on some other field types too), the group_info can contain an array of information instead of only the default value.

buildExposedFiltersGroupForm() uses $this->options['group_info']['default_group'] as default value. This should also be the case in groupForm(). The same logic for default_group_multiple

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡§πŸ‡ͺBelgium matthiasm11

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