dev/core#3482 mailing approval workflow fix
authorBrian Shaughnessy <brian@lcdservices.biz>
Tue, 31 May 2022 19:36:16 +0000 (15:36 -0400)
committerBrian Shaughnessy <brian@lcdservices.biz>
Tue, 31 May 2022 19:36:16 +0000 (15:36 -0400)
CRM/Mailing/Form/Approve.php

index ff5c6ddfe26b4fc55a00d2baeb24f623b07f6acc..1cd4140b037a38eda4af09fe6d96abf055f5a75b 100644 (file)
@@ -129,15 +129,14 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
 
-    $ids = [];
     if (isset($this->_mailingID)) {
-      $ids['mailing_id'] = $this->_mailingID;
+      $params['id'] = $this->_mailingID;
     }
     else {
-      $ids['mailing_id'] = $this->get('mailing_id');
+      $params['id'] = $this->get('mailing_id');
     }
 
-    if (!$ids['mailing_id']) {
+    if (!$params['id']) {
       CRM_Core_Error::statusBounce(ts('No mailing id has been able to be determined'));
     }
 
@@ -154,14 +153,14 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
 
       // also delete any jobs associated with this mailing
       $job = new CRM_Mailing_BAO_MailingJob();
-      $job->mailing_id = $ids['mailing_id'];
+      $job->mailing_id = $params['id'];
       while ($job->fetch()) {
         CRM_Mailing_BAO_MailingJob::del($job->id);
       }
     }
     else {
       $mailing = new CRM_Mailing_BAO_Mailing();
-      $mailing->id = $ids['mailing_id'];
+      $mailing->id = $params['id'];
       $mailing->find(TRUE);
 
       $params['scheduled_date'] = CRM_Utils_Date::processDate($mailing->scheduled_date);