From: monishdeb Date: Tue, 24 Feb 2015 11:38:34 +0000 (+0530) Subject: CRM-16004 and CRM-16001 fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=53133bb0d24b35f900bf7d499ca7e8dc5bf6b7b8;p=civicrm-core.git CRM-16004 and CRM-16001 fixes ---------------------------------------- * CRM-16004: Participant search link broken on "force" search https://issues.civicrm.org/jira/browse/CRM-16004 * CRM-16001: Advanced Search by contribution status throws FATAL error https://issues.civicrm.org/jira/browse/CRM-16001 --- diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 09ce18cbf4..3bc8b53530 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -367,6 +367,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { 'financial_type_id', 'contribution_soft_credit_type_id', 'contribution_status', + 'contribution_status_id', 'contribution_source', 'contribution_trxn_id', 'activity_type_id', diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 5298208350..41b291528d 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -349,8 +349,8 @@ class CRM_Event_BAO_Query { if ($name == 'is_pay_later') { $qillName = $name; } - if ($name == 'participant_role_id') { - $qillName = str_replace('_id', '', $name); + if ($name == 'role_id') { + $qillName = 'participant_role'; } } diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index d83b0345be..cd99eb484a 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -253,12 +253,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { if (!empty($_POST)) { $this->_formValues = $this->controller->exportValues($this->_name); - foreach (array('participant_status_id', 'participant_role_id') as $element) { - $value = CRM_Utils_Array::value($element, $this->_formValues); - if ($value && is_array($value)) { - $this->_formValues[$element] = array('IN' => $value); - } - } } if (empty($this->_formValues)) { @@ -380,20 +374,15 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { if (isset($status)) { if ($status === 'true') { - $statusTypes = CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 1"); + $statusTypes = array_keys(CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 1")); } elseif ($status === 'false') { - $statusTypes = CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 0"); + $statusTypes = array_keys(CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 0")); } elseif (is_numeric($status)) { - $status = (int) $status; - $statusTypes = array($status => CRM_Event_PseudoConstant::participantStatus($status)); - } - $status = array(); - foreach ($statusTypes as $key => $value) { - $status[$key] = 1; + $statusTypes = (int) $status; } - $this->_formValues['participant_status_id'] = $status; + $this->_formValues['participant_status_id'] = $statusTypes; } $role = CRM_Utils_Request::retrieve('role', 'String', @@ -408,14 +397,16 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { $roleTypes = CRM_Event_PseudoConstant::participantRole(NULL, "filter = 0"); } elseif (is_numeric($role)) { - $role = (int) $role; - $roleTypes = array($role => CRM_Event_PseudoConstant::participantRole($role)); + $roleTypes = (int) $role; } - $role = array(); - foreach ($roleTypes as $key => $value) { - $role[$key] = 1; + $this->_formValues['participant_role_id'] = $roleTypes; + } + + foreach (array('participant_status_id', 'participant_role_id') as $element) { + $value = CRM_Utils_Array::value($element, $this->_formValues); + if ($value && is_array($value)) { + $this->_formValues[$element] = array('IN' => $value); } - $this->_formValues['participant_role_id'] = $role; } $type = CRM_Utils_Request::retrieve('type', 'Positive',