Commit c4a346a5 authored by Peacog's avatar Peacog Committed by Rick Hawkins
Browse files

Issue #2952349 by Peacog, NickWilde: Replace uses of each() deprecated in PHP 7.2

parent ba02e6d3
......@@ -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
......
......@@ -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 {
......
Supports Markdown
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