Merge pull request #18891 from civicrm/5.31
[civicrm-core.git] / CRM / Grant / Form / Task.php
index 571c25433db1a017236e9c8e89eb46902b6d153d..a5096f91603ad4aa5586394e7c115ddc5a780d6f 100644 (file)
@@ -34,12 +34,14 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task {
   }
 
   /**
-   * @param CRM_Core_Form $form
+   * @param \CRM_Core_Form_Task $form
+   *
+   * @throws \CRM_Core_Exception
    */
   public static function preProcessCommon(&$form) {
     $form->_grantIds = [];
 
-    $values = $form->controller->exportValues($form->get('searchFormName'));
+    $values = $form->getSearchFormValues();
 
     $form->_task = $values['task'];
     $tasks = CRM_Grant_Task::tasks();
@@ -79,15 +81,7 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task {
 
     $form->_grantIds = $form->_componentIds = $ids;
 
-    //set the context for redirection for any task actions
-    $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
-    $urlParams = 'force=1';
-    if (CRM_Utils_Rule::qfKey($qfKey)) {
-      $urlParams .= "&qfKey=$qfKey";
-    }
-
-    $session = CRM_Core_Session::singleton();
-    $session->replaceUserContext(CRM_Utils_System::url('civicrm/grant/search', $urlParams));
+    $form->setNextUrl('grant');
   }
 
   /**