From 9b1d66174588073f33fdafd652650ee0bd6dcafa Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Tue, 13 Dec 2022 18:50:59 -0500 Subject: [PATCH] E_NOTICES --- CRM/Activity/Form/ActivityView.php | 5 +++++ tests/phpunit/CRM/Activity/Form/ActivityViewTest.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CRM/Activity/Form/ActivityView.php b/CRM/Activity/Form/ActivityView.php index 0d51c0918c..93fb06a828 100644 --- a/CRM/Activity/Form/ActivityView.php +++ b/CRM/Activity/Form/ActivityView.php @@ -83,6 +83,11 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form { } } + // ensure these are set so that they get assigned to the template + $values['mailingId'] = $values['mailingId'] ?? NULL; + $values['campaign'] = $values['campaign'] ?? NULL; + $values['engagement_level'] = $values['engagement_level'] ?? NULL; + // Get the campaign. if ($campaignId = CRM_Utils_Array::value('campaign_id', $defaults)) { $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId); diff --git a/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php b/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php index d52d6f7571..5215221919 100644 --- a/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php +++ b/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php @@ -73,6 +73,9 @@ class CRM_Activity_Form_ActivityViewTest extends CiviUnitTestCase { 'modified_date' => $activityMoreInfo['modified_date'], 'activity_modified_date' => $activityMoreInfo['modified_date'], 'attachment' => NULL, + 'mailingId' => NULL, + 'campaign' => NULL, + 'engagement_level' => NULL, ]; $this->assertEquals($expected, $templateVar); -- 2.25.1