Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
better_exposed_filters
Commits
cee3518c
Commit
cee3518c
authored
Feb 03, 2021
by
lamp5
Committed by
Neslee Canil Pinto
Feb 03, 2021
Browse files
Issue #3152852 by lamp5: Wrong filter "active" for boolean field - regression D7
parent
af5ddaf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/better_exposed_filters.theme.inc
View file @
cee3518c
...
...
@@ -215,7 +215,7 @@ function template_preprocess_bef_links(array &$variables) {
// with the entire options array and remove items from it as needed.
$urlOptions
=
$url
->
getOptions
();
if
(
isset
(
$element
[
'#multiple'
]))
{
if
(
isset
(
$element
[
'#multiple'
])
&&
$element
[
'#multiple'
]
)
{
$newQuery
=
isset
(
$existing_query
[
$name
])
?
$existing_query
[
$name
]
:
[];
if
(
in_array
(
$optionValue
,
$selectedValues
))
{
// Allow users to toggle an option using the same link.
...
...
@@ -234,7 +234,7 @@ function template_preprocess_bef_links(array &$variables) {
}
}
else
{
if
(
$optionValue
==
$element
[
'#value'
])
{
if
(
strval
(
$optionValue
)
=
==
$element
[
'#value'
])
{
// Allow toggle link functionality -- click the same link to turn an
// option on or off.
$newQuery
=
$existing_query
;
...
...
@@ -270,7 +270,10 @@ function template_preprocess_bef_links(array &$variables) {
'#url'
=>
$url
,
];
if
(
in_array
(
$optionValue
,
$selectedValues
))
{
/*
* @see https://stackoverflow.com/questions/13846769/php-in-array-0-value
*/
if
(
in_array
(
strval
(
$optionValue
),
$selectedValues
))
{
$variables
[
'links'
][
$optionValue
][
'#attributes'
][
'class'
][]
=
'bef-link--selected'
;
}
}
...
...
Write
Preview
Supports
Markdown
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