From 3413e5825583178e5df0c3535a8f5e734727edfc Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 15 Aug 2021 09:27:39 +1000 Subject: [PATCH 1/2] [REF] Fix e-notice in APIv3 Profile Test on PHP8 Remove e-notice issue found by dave d --- api/v3/Profile.php | 1 + 1 file changed, 1 insertion(+) 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]; } From 95913c713e7009e371f2128f03242a1d96c43301 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 16 Aug 2021 10:01:07 +1200 Subject: [PATCH 2/2] dev/core#2758 fix task tiles --- CRM/Core/Task.php | 2 +- CRM/Member/Task.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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; }