From 1b6dac986674fecf3957d9abff036304119b6a03 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 12 Aug 2015 16:45:44 +0530 Subject: [PATCH] CRM-17011 fix - Broken smart group regression - membership type, membership status https://issues.civicrm.org/jira/browse/CRM-17011 --- CRM/Contact/Form/Search/Advanced.php | 4 +++- CRM/Member/BAO/Query.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 86b127dc02..8e9f0678d8 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -423,11 +423,13 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { } if ($this->_ssID && empty($_POST)) { - $specialFields = array('contact_type', 'group', 'contact_tags'); + $specialFields = array('contact_type', 'group', 'contact_tags', 'member_membership_type_id', 'member_status_id'); foreach ($defaults as $element => $value) { if (!empty($value) && is_array($value)) { if (in_array($element, $specialFields)) { + $element = str_replace('member_membership_type_id', 'membership_type_id', $element); + $element = str_replace('member_status_id', 'membership_status_id', $element); $defaults[$element] = array_keys($value); } // As per the OK (Operator as Key) value format, value array may contain key diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index d8aa06944c..4f003fcf4c 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -201,7 +201,8 @@ class CRM_Member_BAO_Query { case 'member_status_id': case 'member_membership_type_id': if (is_array($value)) { - $value = array('IN' => array_keys($value)); + $op = 'IN'; + $value = array_keys($value); } case 'membership_status': case 'membership_status_id': -- 2.25.1