From: colemanw Date: Mon, 5 Feb 2024 19:20:42 +0000 (-0500) Subject: AngularManager - Ensure 'basePages' is an array X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=94032c27be8e6bd574cbaf5f37507bfe645e70a5;p=civicrm-core.git AngularManager - Ensure 'basePages' is an array This doesn't change the behavior (historical default mainained, with a comment added about why), just ensures the value is always set to prevent errors when it gets passed to in_array(). --- diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index ce88ed4707..37e115c7b7 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -94,8 +94,9 @@ class Manager { \CRM_Utils_Hook::angularModules($angularModules); foreach ($angularModules as $module => $info) { - // Merge in defaults - $angularModules[$module] += ['basePages' => ['civicrm/a']]; + // This property must be an array. If null, set to the historical default of ['civicrm/a'] + // (historical default preserved for backward-compat reasons, but a better default would be the more common value of []). + $angularModules[$module]['basePages'] ??= ['civicrm/a']; if (!empty($info['settings'])) { \CRM_Core_Error::deprecatedWarning(sprintf('The Angular file "%s" from extension "%s" must be updated to use "settingsFactory" instead of "settings". See https://github.com/civicrm/civicrm-core/pull/19052', $info['module'], $info['ext'])); }