From: Eileen McNaughton Date: Tue, 14 Sep 2021 15:09:49 +0000 (+1200) Subject: dev/core#2817 remove call to getTokenDetails X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2721ebce39e8f3f422e8d296930ebb0cfe9fe1ec;p=civicrm-core.git dev/core#2817 remove call to getTokenDetails Removes the call to getTokenDetails as discussed on https://github.com/civicrm/civicrm-core/pull/21445 As discussed on that PR & related gitlabs I created an extension to try to allow people to have this functionality transitionally if they needed (based on copying code from 5.41 over) - but per the readme https://github.com/eileenmcnaughton/legacytokenhelper/blob/master/README.md the issues I found (under 'known issues') were enough to make me conclude no-one would actually want to install the extension to restore pre-5.43 functionality --- diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 6ca9dd00ad..2c1e432fd7 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -117,8 +117,6 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter public static function postProcess(&$form): void { $formValues = $form->controller->exportValues($form->getName()); [$formValues, $categories, $html_message, $messageToken, $returnProperties] = self::processMessageTemplate($formValues); - $skipOnHold = $form->skipOnHold ?? FALSE; - $skipDeceased = $form->skipDeceased ?? TRUE; $html = $activityIds = []; // CRM-16725 Skip creation of activities if user is previewing their PDF letter(s) @@ -131,32 +129,14 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter } foreach ($form->_contactIds as $item => $contactId) { - $caseId = NULL; - $params = ['contact_id' => $contactId]; - $caseId = $form->getVar('_caseId'); if (empty($caseId) && !empty($form->_caseIds[$item])) { $caseId = $form->_caseIds[$item]; } - [$contact] = CRM_Utils_Token::getTokenDetails($params, - $returnProperties, - $skipOnHold, - $skipDeceased, - NULL, - $messageToken, - 'CRM_Contact_Form_Task_PDFLetterCommon' - ); - - if (civicrm_error($contact)) { - $notSent[] = $contactId; - continue; - } - $tokenHtml = CRM_Core_BAO_MessageTemplate::renderTemplate([ 'contactId' => $contactId, 'messageTemplate' => ['msg_html' => $html_message], - 'tplParams' => ['contact' => $contact], 'tokenContext' => $caseId ? ['caseId' => $caseId] : [], 'disableSmarty' => (!defined('CIVICRM_MAIL_SMARTY') || !CIVICRM_MAIL_SMARTY), ])['html'];