I just fix a problem about "An illegal choice has been detected..." with module "better_exposed_filters"
Configuration :
- Module "better_exposed_filters" installed
- Create a view
- Expose a filter as collapsible checkbox with better exposed filter
- Check the filter option remember
Then go to your view
- Check one checkbox on the collapsible list and then submit (it work perfectly)
- Go to another page and come back to your view (or actualize the page)
- Then an error appear with message "An illegal choice has been detected..."
- As you can see, all checkboxes are checked
The bug came from the class "Drupal\views\Plugin\views\filter\FilterPluginBase"
To fix it, open the file and replace last line from the method : "storeExposedInput"
=> you must remove integer values : 0
$session[$this->options['expose']['identifier']] = $input[$this->options['expose']['identifier']];
TO
// Fix multiple checkbox (Illegal Choice has been detected)
$value = $input[$this->options['expose']['identifier']];
if($this->options['expose']['multiple'] && is_array($value)){
$value = array_filter($value, function($value) {
return $value !== 0;
});
}
$session[$this->options['expose']['identifier']] = $value;
Sorry, but I can't make a pull request right now, but I hope it will help