Commit e1f71c7a authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-5071: fix output of date range filters with patch from...

ISTWCMS-5071: fix output of date range filters with patch from https://www.drupal.org/project/better_exposed_filters/issues/3163486#comment-14201891
parent 0225b9d9
......@@ -226,8 +226,12 @@ abstract class FilterWidgetBase extends BetterExposedFiltersWidgetBase implement
}
}
// Add possible field wrapper to validate for "between" operator.
$element_wrapper = $field_id . '_wrapper';
$filter_elements = [
$identifier,
$element_wrapper,
$filter->options['expose']['operator_id'],
];
......@@ -238,6 +242,23 @@ abstract class FilterWidgetBase extends BetterExposedFiltersWidgetBase implement
continue;
}
// "Between" operator fields to validate for.
$fields = ['min', 'max'];
// Check if the the element is apart of a wrapper.
if($element == $element_wrapper){
$wrapper_array= $form[$element];
// Determine if wrapper element has min or max fields, if so then update type.
if (array_intersect($fields, array_keys($wrapper_array[$field_id]))) {
$form[$element]['#type'] = 'container';
}
} else {
// Determine if element has min or max child fields, if so then update type.
if (array_intersect($fields, array_keys($form[$field_id]))) {
$form[$element]['#type'] = 'container';
}
}
// Move collapsible elements.
if ($is_collapsible) {
$this->addElementToGroup($form, $form_state, $element, $field_id . '_collapsible');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment