diff --git a/CHANGELOG.md b/CHANGELOG.md index f4840ebec6fb79f40f9e3f13820ff699227c6903..680dafcee72c0fde9a172dc225ec01955ece7d3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Version 1.120 (not yet released) -* Show only one date when both dates are the same day. See !129 +* Show only one date when both dates are the same day. See !129 +* Fix for combining data processor and the donrec extension. # Version 1.119 diff --git a/CRM/DataprocessorSearch/StateMachine/Search.php b/CRM/DataprocessorSearch/StateMachine/Search.php index d4f164d717d3decc2d1b7a3edf7e05783c0d27b6..66e77a257564842d9328e019d86a0411e59dd148 100644 --- a/CRM/DataprocessorSearch/StateMachine/Search.php +++ b/CRM/DataprocessorSearch/StateMachine/Search.php @@ -142,7 +142,10 @@ class CRM_DataprocessorSearch_StateMachine_Search extends CRM_Core_StateMachine /** @var CRM_Core_State $state */ $state = $this->getState($pageName); if ($state->getType() & CRM_Core_State::FINISH) { - if (empty($destination)) { + $tasksToIgnore = self::taskNamesToIgnoreForDestination(); + if (!empty($this->_task) && in_array($this->_task, $tasksToIgnore)) { + return $destination; + } elseif (empty($destination)) { $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this->_controller); $urlPath = CRM_Utils_System::currentPath(); $urlParams = 'force=1'; @@ -156,5 +159,23 @@ class CRM_DataprocessorSearch_StateMachine_Search extends CRM_Core_StateMachine return $destination; } + /** + * Returns a list of task names upon which we don't set the destination. + * + * This is a little hack for the DonRec extension. + * The donrec extension does a push of the user context in the search task rather than a redirect or an implementation + * of a task with multiple steps. + * + * However our solution is also a hack to redirect after a task back to the data processor. + * + * @return string[] + */ + public static function taskNamesToIgnoreForDestination(): array { + return [ + 'CRM_Donrec_Form_Task_ContributeTask', + 'CRM_Donrec_Form_Task_DonrecTask' + ]; + } + }