From: Eileen McNaughton Date: Tue, 17 Aug 2021 23:19:45 +0000 (+1200) Subject: dev/core#2758 - Fix contribution activity campaign propagation ...more X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e2b8620ed165ee006a0233611f597451fe79c31d;p=civicrm-core.git 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 --- 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']) {