From 1df95bdbf26e3dc8dd2c7174ef7dc8db05b32925 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 25 Apr 2017 13:09:20 +1000 Subject: [PATCH] Fix Tests --- CRM/Activity/BAO/Activity.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 18e0583b43..4d4a75d3b6 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -683,12 +683,14 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { // This is a temporary fix we need to figure out the rules around // the right permissions to access Activities. // This attpemts to reduce fatal errors in 4.7.19 RC. - foreach ($activityIDs as $key => $activityId) { - try { - civicrm_api3('Activity', 'get', array('id' => $activityId, 'check_permissions' => 1)); - } - catch (Exception $e) { - unset($activityIDs[$key]); + if (!empty($activityIDs)) { + foreach ($activityIDs as $key => $activityId) { + try { + civicrm_api3('Activity', 'get', array('id' => $activityId, 'check_permissions' => 1)); + } + catch (Exception $e) { + unset($activityIDs[$key]); + } } } -- 2.25.1