From e2b8620ed165ee006a0233611f597451fe79c31d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 18 Aug 2021 11:19:45 +1200 Subject: [PATCH] dev/core#2758 - Fix contribution activity campaign propagation ...more Fixes a scenario where the value can be 'null' and then fatals I hit this creating a new membership record on a stock build --- CRM/Contribute/BAO/Contribution.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 6e886dca52..10d7689d48 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -546,7 +546,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { 'status_id:name' => $isCompleted ? 'Completed' : 'Scheduled', 'skipRecentView' => TRUE, 'subject' => CRM_Activity_BAO_Activity::getActivitySubject($contribution), - 'campaign_id' => $contribution->campaign_id, + 'campaign_id' => !is_numeric($contribution->campaign_id) ? NULL : $contribution->campaign_id, 'id' => $existingActivity['id'] ?? NULL, ]; if (!$activityParams['id']) { -- 2.25.1