From c4dd21561bf110ae6e9f76b404e619ba97220794 Mon Sep 17 00:00:00 2001 From: olayiwola-compucorp Date: Wed, 24 Jan 2024 17:03:43 +0100 Subject: [PATCH] CPO-147: Allow Anonymous User to submit case with roles via webform --- CRM/Civicase/Service/CaseRoleCreationPostProcess.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Civicase/Service/CaseRoleCreationPostProcess.php b/CRM/Civicase/Service/CaseRoleCreationPostProcess.php index 2ddba3ce0..9b7a86124 100644 --- a/CRM/Civicase/Service/CaseRoleCreationPostProcess.php +++ b/CRM/Civicase/Service/CaseRoleCreationPostProcess.php @@ -189,6 +189,10 @@ private function setRelationshipsInactive(array $relIds, string $endDate) { * Activity Subject. */ private function createCaseActivity($caseId, $activityType, $subject) { + if (empty(CRM_Core_Session::getLoggedInContactID())) { + return; + } + civicrm_api3('Activity', 'create', [ 'case_id' => $caseId, 'target_contact_id' => $this->getCaseClients($caseId),