Commit 8ff61599 authored by hargobind's avatar hargobind Committed by Neslee Canil Pinto
Browse files

Issue #3231398 by hargobind: Order of secondary exposed form filter fields

parent d31e46b4
...@@ -1166,6 +1166,9 @@ dateFormat: "dd-mm-yy" ...@@ -1166,6 +1166,9 @@ dateFormat: "dd-mm-yy"
// Shorthand for all filters in this view. // Shorthand for all filters in this view.
$filters = $form_state['view']->display_handler->handlers['filter']; $filters = $form_state['view']->display_handler->handlers['filter'];
// Get the order of all filters.
$filters_order = array_flip(array_keys($filters));
// Go through each saved option looking for Better Exposed Filter settings. // Go through each saved option looking for Better Exposed Filter settings.
foreach ($settings as $label => $options) { foreach ($settings as $label => $options) {
// Sanity check: Ensure this filter is an exposed filter. // Sanity check: Ensure this filter is an exposed filter.
...@@ -1783,6 +1786,9 @@ dateFormat: "dd-mm-yy" ...@@ -1783,6 +1786,9 @@ dateFormat: "dd-mm-yy"
if (isset($filters[$label]->position)) { if (isset($filters[$label]->position)) {
$secondary[$identifier]['#bef_position'] = $filters[$label]->position * 2; $secondary[$identifier]['#bef_position'] = $filters[$label]->position * 2;
} }
else {
$secondary[$identifier]['#bef_position'] = ($filters_order[$label] * 2);
}
// Move exposed operators with exposed filters. // Move exposed operators with exposed filters.
if (!empty($filters[$label]->options['expose']['use_operator'])) { if (!empty($filters[$label]->options['expose']['use_operator'])) {
...@@ -1795,6 +1801,9 @@ dateFormat: "dd-mm-yy" ...@@ -1795,6 +1801,9 @@ dateFormat: "dd-mm-yy"
if (isset($filters[$label]->position)) { if (isset($filters[$label]->position)) {
$secondary[$op_id]['#bef_position'] = ($filters[$label]->position * 2) - 1; $secondary[$op_id]['#bef_position'] = ($filters[$label]->position * 2) - 1;
} }
else {
$secondary[$op_id]['#bef_position'] = ($filters_order[$label] * 2) - 1;
}
} }
} }
} }
......
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