[REF][PHP8.2] Declare donorEmail and donorDisplayName properties
authorBradley Taylor <hello@brad-taylor.co.uk>
Sat, 18 Nov 2023 17:03:36 +0000 (17:03 +0000)
committerBradley Taylor <hello@brad-taylor.co.uk>
Sat, 18 Nov 2023 17:03:36 +0000 (17:03 +0000)
CRM/Contribute/Form/CancelSubscription.php
CRM/Contribute/Form/UpdateSubscription.php

index 8ce402c57484ea801c8ee6d55f78c0cb95b83861..450132d2444060f01d0ea6faa2135ec1144bb61b 100644 (file)
@@ -28,6 +28,13 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Contribute_Form_Contrib
    */
   protected $_donorEmail = '';
 
+  /**
+   * The contributor display name (for emails)
+   *
+   * @var string
+   */
+  protected $_donorDisplayName = '';
+
   /**
    * Should custom data be suppressed on this form.
    *
index 459dbcd8189718072015196dca310eb51792acc8..e68c618189975286e7f8f8aa248bbcdc5b4cd5f5 100644 (file)
@@ -43,6 +43,13 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
    */
   public $_contactID;
 
+  /**
+   * The contributor email
+   *
+   * @var string
+   */
+  protected $_donorEmail = '';
+
   /**
    * Pre-processing for the form.
    *
@@ -112,7 +119,8 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
     $this->assign('editableScheduleFields', array_diff($this->editableScheduleFields, $alreadyHardCodedFields));
 
     if ($this->_subscriptionDetails->contact_id) {
-      [$this->_donorDisplayName, $this->_donorEmail] = CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
+      $contactDetails = CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
+      $this->_donorEmail = $contactDetails[1];
     }
 
     $this->setTitle(ts('Update Recurring Contribution'));