Steps to reproduce
Use the same steps to reproduce as in #3294700: Date filter shows error in view exposed group filter with multiple select option, 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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2025-06-11 at 5.25.54 PM.png | 136.18 KB | apmsooner |
| #3 | drupal-views_exposed_grouped_filter_default_value-3523482-MR12082.patch | 1.57 KB | matthiasm11 |
Issue fork drupal-3523482
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
matthiasm11 commentedAttached a static patch of the MR.
Comment #4
lendudeThis will need some test coverage and looking into the test failure.
Comment #5
apmsooner commentedI've run into this issue as well but the patch as is didn't fix it. The issue i'm seeing is that when a value is set in the exposed filter for filter type single and then the filter type changes to grouped, the value structure is different and the select widget for grouped filter can't find the current value. I'm attaching a screenshot of what is working for me locally by adding the highlighted part.