E_NOTICES
authordemeritcowboy <demeritcowboy@hotmail.com>
Tue, 13 Dec 2022 23:50:59 +0000 (18:50 -0500)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Wed, 14 Dec 2022 03:06:11 +0000 (22:06 -0500)
CRM/Activity/Form/ActivityView.php
tests/phpunit/CRM/Activity/Form/ActivityViewTest.php

index 0d51c0918c4c342e3edb3a982a49e272695fb7e7..93fb06a828221e9b7f12099639818271c92d3c4a 100644 (file)
@@ -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);
index d52d6f7571faf033d48e24d6d83076ac16628f8f..5215221919225d4312a67b979c943ca24aa427d1 100644 (file)
@@ -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);