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 8b61b0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Core/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ 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) {
$parentPath = $menu[$parentPath] ?? [];
if (CRM_Utils_Array::value($field, $parentPath) !== NULL) {
$fieldsPresent[$field] = TRUE;
$menu[$path][$field] = $menu[$parentPath][$field];
}
Expand Down

0 comments on commit 8b61b0b

Please sign in to comment.