Merge pull request #23213 from eileenmcnaughton/post
[civicrm-core.git] / CRM / Event / Form / Search.php
index 30001106871355690a3bc30630499c7825466323..0c2ce4dbf53b0adaeb49ea72987d4f34d26a8dea 100644 (file)
@@ -79,6 +79,9 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
    * @throws \CiviCRM_API3_Exception
    */
   public function preProcess() {
+    // SearchFormName is deprecated & to be removed - the replacement is for the task to
+    // call $this->form->getSearchFormValues()
+    // A couple of extensions use it.
     $this->set('searchFormName', 'Search');
 
     /**
@@ -197,9 +200,9 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
           'id' => $this->_ssID,
           'name' => CRM_Contact_BAO_SavedSearch::getName($this->_ssID, 'title'),
         ];
-        $this->assign_by_ref('savedSearch', $savedSearchValues);
-        $this->assign('ssID', $this->_ssID);
       }
+      $this->assign('savedSearch', $savedSearchValues ?? NULL);
+      $this->assign('ssID', $this->_ssID);
 
       $this->addTaskMenu($tasks);
     }