Commit 13d10b1b authored by oadaeh's avatar oadaeh Committed by Rick Hawkins
Browse files

Issue #2946585 by oadaeh, bkosborne: Remove usage of deprecrated each()...

Issue #2946585 by oadaeh, bkosborne: Remove usage of deprecrated each() function for PHP 7.2+ future proofing
parent 3955a79b
......@@ -105,7 +105,8 @@ function theme_select_as_checkboxes($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
......@@ -176,7 +177,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
......@@ -331,7 +333,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.
......@@ -518,7 +521,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
......
......@@ -1201,7 +1201,8 @@ dateFormat: "dd-mm-yy"
// dsm($form[$filter_id]['#options'][$index]->option, "$filter_id at $index");
// Taxonomy term filters are stored as objects. Use str_replace
// to ensure that keep hyphens for hierarchical filters.
list($tid, $original) = each($form[$filter_id]['#options'][$index]->option);
$tid = key($form[$filter_id]['#options'][$index]->option);
$original = current($form[$filter_id]['#options'][$index]->option);
$form[$filter_id]['#options'][$index]->option[$tid] = str_replace($option, $rewrite[$option], $original);
}
else {
......@@ -1532,7 +1533,8 @@ dateFormat: "dd-mm-yy"
foreach ($opts as $index => $opt) {
if (is_object($opt)) {
reset($opt->option);
list($key, $val) = each($opt->option);
$key = key($opt->option);
$val = current($opt->option);
$form[$filter_id]['#options'][$key] = $val;
}
else {
......@@ -1667,7 +1669,7 @@ dateFormat: "dd-mm-yy"
foreach ($form[$filter_id]['#options'] as $tid => $option) {
if (is_object($option)) {
reset($option->option);
list ($tid, ) = each($option->option);
$tid = key($option->option);
}
$tids[] = $tid;
}
......
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