CRM-17075 switch membership_type_id to use entity reference
[civicrm-core.git] / CRM / Member / Form / Search.php
index 47c6e488f3c7cf35c0a89adbacec2927dfe84a7b..7d42293edbcc656f64ae34815f54105cbd80c11e 100644 (file)
@@ -68,6 +68,13 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search {
    */
   protected $_prefix = "member_";
 
+  /**
+   * Declare entity reference fields as they will need to be converted to using 'IN'.
+   *
+   * @var array
+   */
+  protected $entityReferenceFields = array('membership_type_id');
+
   /**
    * Processing needed for buildForm and later.
    */
@@ -114,7 +121,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search {
       );
     }
 
-    $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
+    $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields);
     $selector = new CRM_Member_Selector_Search($this->_queryParams,
       $this->_action,
       NULL,
@@ -197,7 +204,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search {
 
     CRM_Core_BAO_CustomValue::fixCustomFieldValue($this->_formValues);
 
-    $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
+    $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields);
 
     $this->set('formValues', $this->_formValues);
     $this->set('queryParams', $this->_queryParams);