Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
better_exposed_filters
Commits
8ff61599
Commit
8ff61599
authored
Sep 06, 2021
by
hargobind
Committed by
Neslee Canil Pinto
Sep 06, 2021
Browse files
Issue #3231398 by hargobind: Order of secondary exposed form filter fields
parent
d31e46b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
better_exposed_filters_exposed_form_plugin.inc
better_exposed_filters_exposed_form_plugin.inc
+9
-0
No files found.
better_exposed_filters_exposed_form_plugin.inc
View file @
8ff61599
...
...
@@ -1166,6 +1166,9 @@ dateFormat: "dd-mm-yy"
// Shorthand for all filters in this view.
$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.
foreach
(
$settings
as
$label
=>
$options
)
{
// Sanity check: Ensure this filter is an exposed filter.
...
...
@@ -1783,6 +1786,9 @@ dateFormat: "dd-mm-yy"
if
(
isset
(
$filters
[
$label
]
->
position
))
{
$secondary
[
$identifier
][
'#bef_position'
]
=
$filters
[
$label
]
->
position
*
2
;
}
else
{
$secondary
[
$identifier
][
'#bef_position'
]
=
(
$filters_order
[
$label
]
*
2
);
}
// Move exposed operators with exposed filters.
if
(
!
empty
(
$filters
[
$label
]
->
options
[
'expose'
][
'use_operator'
]))
{
...
...
@@ -1795,6 +1801,9 @@ dateFormat: "dd-mm-yy"
if
(
isset
(
$filters
[
$label
]
->
position
))
{
$secondary
[
$op_id
][
'#bef_position'
]
=
(
$filters
[
$label
]
->
position
*
2
)
-
1
;
}
else
{
$secondary
[
$op_id
][
'#bef_position'
]
=
(
$filters_order
[
$label
]
*
2
)
-
1
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment