diff --git a/CRM/Core/Task.php b/CRM/Core/Task.php index aab7757d3e4f..3ef3690a722e 100644 --- a/CRM/Core/Task.php +++ b/CRM/Core/Task.php @@ -47,7 +47,7 @@ abstract class CRM_Core_Task { * * @var array */ - public static $_tasks = NULL; + public static $_tasks = []; /** * @var string diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index f9f7589ae8f3..dd04d9e062f8 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -151,7 +151,7 @@ public static function taskTitles() { * set of tasks that are valid for the user */ public static function permissionedTaskTitles($permission, $params = []) { - $tasks = self::getTitlesFilteredByPermission(self::$_tasks, $permission === CRM_Core_Permission::EDIT); + $tasks = self::getTitlesFilteredByPermission(self::tasks(), $permission === CRM_Core_Permission::EDIT); return parent::corePermissionedTaskTitles($tasks, $permission, $params); } @@ -165,8 +165,7 @@ public static function permissionedTaskTitles($permission, $params = []) { * the set of tasks for a group of members */ public static function getTask($value) { - self::tasks(); - if (!$value || empty(self::$_tasks[$value])) { + if (!$value || empty(self::tasks()[$value])) { // Make the print task the default $value = self::TASK_PRINT; } diff --git a/api/v3/Profile.php b/api/v3/Profile.php index eb78e51e0dfe..742af495fad6 100644 --- a/api/v3/Profile.php +++ b/api/v3/Profile.php @@ -604,6 +604,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour, */ } } + $profileFields[$profileID] = $profileFields[$profileID] ?? []; uasort($profileFields[$profileID], "_civicrm_api3_order_by_weight"); return $profileFields[$profileID]; }