From fb622d6c6f1fce4c4172ef51d09bb31cbee6520c Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Tue, 17 Apr 2018 12:23:51 +0530 Subject: [PATCH] additional fix --- CRM/Case/Form/Task/PDF.php | 2 +- CRM/Contact/Form/Task/EmailCommon.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CRM/Case/Form/Task/PDF.php b/CRM/Case/Form/Task/PDF.php index 881dcac765..336204180d 100644 --- a/CRM/Case/Form/Task/PDF.php +++ b/CRM/Case/Form/Task/PDF.php @@ -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); } /** diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 51e0478c47..02b146792e 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -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(); -- 2.25.1