From: eileen Date: Fri, 6 Mar 2020 20:33:02 +0000 (+1300) Subject: Fix passing a non-array to CRM_Utils_Array::value X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8d9ce16ae9bc909b975fc39e80aab6009a151d3c;p=civicrm-core.git Fix passing a non-array to CRM_Utils_Array::value As surfaced in https://test.civicrm.org/job/CiviCRM-Core-PR/32543/console when we tested deprecating passing in a non-array --- diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index f370b8cacb..9b767aeb97 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -227,9 +227,10 @@ class CRM_Core_Menu { foreach ($fieldsToPropagate as $field) { if (!$fieldsPresent[$field]) { - if (CRM_Utils_Array::value($field, CRM_Utils_Array::value($parentPath, $menu)) !== NULL) { + $fieldInParentMenu = $menu[$parentPath][$field] ?? NULL; + if ($fieldInParentMenu !== NULL) { $fieldsPresent[$field] = TRUE; - $menu[$path][$field] = $menu[$parentPath][$field]; + $menu[$path][$field] = $fieldInParentMenu; } } }