From b4d3021ecf0807fe0f5413e7af9400a9213e0539 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 7 Mar 2020 09:33:02 +1300 Subject: [PATCH] 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 --- CRM/Core/Menu.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index f370b8cacb6b..626bd54ab40c 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -227,9 +227,10 @@ public static function fillMenuValues(&$menu, $path) { 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; } } }