CRM-17755: Nesting of operators for event search form
authoryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 28 Dec 2015 10:07:26 +0000 (15:37 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 28 Dec 2015 10:07:26 +0000 (15:37 +0530)
----------------------------------------
* CRM-17755: Nesting of operators for event search form
  https://issues.civicrm.org/jira/browse/CRM-17755

CRM/Event/Form/Search.php

index 92b7aea6c22ddfe7814fc235068be9a71993e099..6fbf40a32196b4ed3bd0101e24a659d847b63042 100644 (file)
@@ -423,11 +423,10 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
       elseif (is_numeric($status)) {
         $statusTypes = (int) $status;
       }
-
-      $this->_formValues['participant_status_id'] = is_array($statusTypes) ? array('IN' => array_keys($statusTypes)) : $statusTypes;
-    }
-    elseif ($statusTypes = CRM_Utils_Array::value('participant_status_id', $this->_formValues)) {
-      $this->_formValues['participant_status_id'] = is_array($statusTypes) ? array('IN' => $statusTypes) : $statusTypes;
+      elseif (is_array($status) && !array_key_exists('IN', $status)) {
+        $statusTypes = array_keys($status);
+      }
+      $this->_formValues['participant_status_id'] = is_array($statusTypes) ? array_keys($statusTypes) : $statusTypes;
     }
 
     $role = CRM_Utils_Request::retrieve('role', 'String',