Skip to content

Commit

Permalink
Fix passing a non-array to CRM_Utils_Array::value
Browse files Browse the repository at this point in the history
As surfaced in https://test.civicrm.org/job/CiviCRM-Core-PR/32543/console when we tested deprecating
passing in a non-array
  • Loading branch information
eileenmcnaughton committed Mar 6, 2020
1 parent 40cbd64 commit b4d3021
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CRM/Core/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit b4d3021

Please sign in to comment.