Skip to content

Commit

Permalink
Restore the entity specific field name to handle legacy code and allo…
Browse files Browse the repository at this point in the history
…w tokens to work properly (eg. PDF letter)
  • Loading branch information
mattwire committed May 7, 2018
1 parent 6e3090f commit 39fecc8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CRM/Core/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 39fecc8

Please sign in to comment.