additional fix
authordeb.monish <monish.deb@jmaconsulting.biz>
Tue, 17 Apr 2018 06:53:51 +0000 (12:23 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Tue, 17 Apr 2018 06:53:51 +0000 (12:23 +0530)
CRM/Case/Form/Task/PDF.php
CRM/Contact/Form/Task/EmailCommon.php

index 881dcac7654e00a0506e052754aae5a1a34a47fc..336204180d577efcdc9cc2b8a459b2866ce90640 100644 (file)
@@ -50,10 +50,10 @@ class CRM_Case_Form_Task_PDF extends CRM_Case_Form_Task {
    * Build all the data structures needed to build the form.
    */
   public function preProcess() {
+    CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
     $this->skipOnHold = $this->skipDeceased = FALSE;
     parent::preProcess();
     $this->setContactIDs();
-    CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
   }
 
   /**
index 51e0478c478cbd5846fa5d1ec4e8ef38badcd7b8..02b146792ef9c3b7ac4a03b91477697d4de35787 100644 (file)
@@ -69,11 +69,10 @@ class CRM_Contact_Form_Task_EmailCommon {
 
     $form->_emails = array();
 
+    // @TODO remove these line and to it somewhere more appropriate. Currently some classes (e.g Case
+    // are having to re-write contactIds afterwards due to this inappropriate variable setting
     // If we don't have any contact IDs, use the logged in contact ID
-    if (empty($form->_contactIds)) {
-      $contactID = CRM_Core_Session::singleton()->getLoggedInContactID();
-      $form->_contactIds = array($contactID);
-    }
+    $form->_contactIds = $form->_contactIds ?: [CRM_Core_Session::getLoggedInContactID()];
 
     $fromEmailValues = CRM_Core_BAO_Email::getFromEmail();