From 39fecc8ad7e1acb389babde7271e0270d14ce611 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Thu, 5 Apr 2018 10:50:30 +0100 Subject: [PATCH] Restore the entity specific field name to handle legacy code and allow tokens to work properly (eg. PDF letter) --- CRM/Core/Form/Task.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Core/Form/Task.php b/CRM/Core/Form/Task.php index b558193e95d8..2a487ba70f1d 100644 --- a/CRM/Core/Form/Task.php +++ b/CRM/Core/Form/Task.php @@ -136,6 +136,12 @@ public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_entityIds = $form->_componentIds = $ids; + // Some functions (eg. PDF letter tokens) rely on Ids being in specific fields rather than the generic $form->_entityIds + // So we set that specific field here (eg. for cases $form->_caseIds = $form->_entityIds). + // FIXME: This is really to handle legacy code that should probably be updated to use $form->_entityIds + $entitySpecificIdsName = '_' . $form::$entityShortname . 'Ids'; + $form->$entitySpecificIdsName = $form->_entityIds; + //set the context for redirection for any task actions $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form); $urlParams = 'force=1';