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
c4a346a5
Commit
c4a346a5
authored
Apr 13, 2018
by
Peacog
Committed by
Rick Hawkins
Apr 13, 2018
Browse files
Issue #2952349 by Peacog, NickWilde: Replace uses of each() deprecated in PHP 7.2
parent
ba02e6d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
better_exposed_filters.theme
View file @
c4a346a5
...
...
@@ -87,7 +87,8 @@ function theme_select_as_hidden($vars) {
// Check for Taxonomy-based filters.
if
(
is_object
(
$elem
))
{
$slice
=
array_slice
(
$elem
->
option
,
0
,
1
,
TRUE
);
list
(
$option
,
$elem
)
=
each
(
$slice
);
$option
=
key
(
$slice
);
$elem
=
current
(
$slice
);
}
// Check for optgroups. Put subelements in the $element_set array and add a
...
...
@@ -212,7 +213,8 @@ function theme_select_as_tree($vars) {
// Check for Taxonomy-based filters.
if
(
is_object
(
$option_label
))
{
$slice
=
array_slice
(
$option_label
->
option
,
0
,
1
,
TRUE
);
list
(
$option_value
,
$option_label
)
=
each
(
$slice
);
$option_value
=
key
(
$slice
);
$option_label
=
current
(
$slice
);
}
// Check for optgroups -- which is basically a two-level deep tree.
...
...
@@ -391,7 +393,8 @@ function theme_select_as_links($vars) {
// Check for Taxonomy-based filters.
if
(
is_object
(
$elem
))
{
$slice
=
array_slice
(
$elem
->
option
,
0
,
1
,
TRUE
);
list
(
$option
,
$elem
)
=
each
(
$slice
);
$option
=
key
(
$slice
);
$elem
=
current
(
$slice
);
}
// Check for optgroups. Put subelements in the $element_set array and add
...
...
src/Plugin/views/exposed_form/BetterExposedFilters.php
View file @
c4a346a5
...
...
@@ -1342,7 +1342,8 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
}
else
{
if
(
$return
[
$index
]
instanceof
\
stdClass
)
{
list
(
$tid
,
$text
)
=
each
(
$return
[
$index
]
->
option
);
$tid
=
key
(
$return
[
$index
]
->
option
);
$text
=
current
(
$return
[
$index
]
->
option
);
$return
[
$index
]
->
option
[
$tid
]
=
$rewrites
[
$text
];
}
else
{
...
...
@@ -1377,7 +1378,8 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
// need to be converted to text.
if
(
is_object
(
$value
)
&&
!
is_a
(
$value
,
'Drupal\Core\StringTranslation\TranslatableMarkup'
))
{
reset
(
$value
->
option
);
list
(
$key
,
$val
)
=
each
(
$value
->
option
);
$key
=
key
(
$value
->
option
);
$val
=
current
(
$value
->
option
);
$clean
[
$key
]
=
$val
;
}
else
{
...
...
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