From 9bef4ca533c930368e85b60778b74a3d004779d6 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 8 Aug 2021 17:23:39 +1200 Subject: [PATCH] Move make-sure-single-set out of shared function 3 places in the code call this - in 2 _single is declared on the class as false & hence don't need this - ergo it is only being done for the one remaining place so it's not shared it's just a helper for that code & we should return it --- CRM/Contact/Form/Task/EmailCommon.php | 5 ----- CRM/Contact/Form/Task/EmailTrait.php | 2 -- CRM/Contact/Form/Task/PDFLetterCommon.php | 4 ++++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 02a4df9d54..270aee547f 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -31,11 +31,6 @@ class CRM_Contact_Form_Task_EmailCommon { * @throws \CiviCRM_API3_Exception */ public static function preProcessFromAddress(&$form, $bounce = TRUE) { - if (!isset($form->_single)) { - // @todo ensure this is already set. - $form->_single = FALSE; - } - $form->_emails = []; // @TODO remove these line and to it somewhere more appropriate. Currently some classes (e.g Case diff --git a/CRM/Contact/Form/Task/EmailTrait.php b/CRM/Contact/Form/Task/EmailTrait.php index df222411a1..23ff1bf28e 100644 --- a/CRM/Contact/Form/Task/EmailTrait.php +++ b/CRM/Contact/Form/Task/EmailTrait.php @@ -30,8 +30,6 @@ trait CRM_Contact_Form_Task_EmailTrait { */ public $_single = FALSE; - public $_noEmails = FALSE; - /** * All the existing templates in the system. * diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 51ac8c9ad6..8d4db05058 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -42,6 +42,10 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter * @param CRM_Core_Form $form */ public static function preProcess(&$form) { + if (!isset($form->_single)) { + // @todo ensure this is already set. + $form->_single = FALSE; + } CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($form); $messageText = []; $messageSubject = []; -- 2.25.1