Skip to content

Commit

Permalink
Merged in atrium-3767 (pull request civicrm#5)
Browse files Browse the repository at this point in the history
Atrium 3767 fix searching on memebrship type in advanced search
  • Loading branch information
seamuslee001 committed Sep 29, 2015
2 parents 5ae1e06 + 956984f commit b1521a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions CRM/Contact/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {

protected $_modeValue;

/**
* Declare entity reference fields as they will need to be converted to using 'IN'.
*
* @var array
*/
protected $entityReferenceFields = array('membership_type_id');

/**
* Name of the selector to use.
*/
Expand Down Expand Up @@ -560,7 +567,7 @@ public function preProcess() {
$this->_formValues = $this->controller->exportValues($this->_name);

$this->normalizeFormValues();
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields);
$this->_returnProperties = &$this->returnProperties();

// also get the uf group id directly from the post value
Expand All @@ -578,7 +585,7 @@ public function preProcess() {
}
else {
$this->_formValues = $this->get('formValues');
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields);
$this->_returnProperties = &$this->returnProperties();
if (!empty($this->_ufGroupID)) {
$this->set('id', $this->_ufGroupID);
Expand Down
3 changes: 1 addition & 2 deletions CRM/Contact/Form/Search/Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function postProcess() {

CRM_Core_BAO_CustomValue::fixCustomFieldValue($this->_formValues);

$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields);
$this->_returnProperties = &$this->returnProperties();
parent::postProcess();
}
Expand Down Expand Up @@ -370,7 +370,6 @@ public function normalizeFormValues() {
'contribution_status',
'contribution_status_id',
'contribution_source',
'membership_type_id',
'membership_status_id',
'participant_status_id',
'contribution_trxn_id',
Expand Down

0 comments on commit b1521a9

Please sign in to comment.