Problem/Motivation
I'd like to have a View using an Grouped Exposed Filter with Multiple selections, using a Category field, but setting Grouped and Multiple selections causes a 500 error when trying to save.
Steps to reproduce
Create a Grouped Exposed Filter:
'Expose this filter to visitors, to allow them to change it' - checked
'Filter type to expose' - 'Grouped filters'
'Widget type' - 'Radios'
'Allow multiple selections' - checked
Create groupings
Save
For me this returns the following error in the console:
The website encountered an unexpected error. Please try again later.
TypeError: Illegal offset type in isset or empty in Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->validateExposed() (line 355 of core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php).
The culprit appears to be 'Allow multiple selections', without this the View will save
Proposed resolution
From what i can see the following line is at fault, the problem being that $input contains an array
if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
$this->validated_exposed_input = $this->options['group_info']['group_items'][$input]['value'];
return;
}
Remaining tasks
User interface changes
API changes
Data model changes