From 8d9ce16ae9bc909b975fc39e80aab6009a151d3c 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 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; } } } -- 2.25.1