From efe094b6d9cf57dae555f2c97bffed0de555ff93 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 b558193e95..2a487ba70f 100644 --- a/CRM/Core/Form/Task.php +++ b/CRM/Core/Form/Task.php @@ -136,6 +136,12 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form { $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'; -- 2.25.1