As surfaced in https://test.civicrm.org/job/CiviCRM-Core-PR/32543/console when we tested deprecating
passing in a non-array
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;
}
}
}