With https://www.drupal.org/project/drupal/issues/3347343, Drupal 10.4 has gained the ability to use select and autocomplete entity reference exposed filters for any entity reference field -- not just taxonomy terms.
With this change, it appears that \Drupal\business_rules\Plugin\EntityReferenceSelection\BusinessRulesViewsSelection::settingsFormValidate is causing the exposed filter settings form to not save properly. There is code in \Drupal\views\Plugin\views\filter\EntityReference::buildExtraOptionsForm that removes the the element validator for ViewsSelection but this code doesn't work on BusinessRulesViewsSelection
if ($selection_handler instanceof ViewsSelection) {
if (isset($sub_handler_settings['view']['no_view_help'])) {
// If there are no views with entity reference displays,
// ViewsSelection still validates the view.
// This will prevent form config extra form submission,
// so we remove it here.
unset($sub_handler_settings['view']['#element_validate']);
}
}
I don't think this solution in core is particularly good, but we need something similar to skip the BusinessRulesViewsSelection::settingsFormValidate callback when it is not the selected sub handler for the entity reference exposed filters.
Issue fork business_rules-3539644
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