From: eileenmcnaugton Date: Wed, 12 Aug 2015 00:12:56 +0000 (+1200) Subject: CRM-17011 fix for smart group regression X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a24603f0824d3d40e63ed5ce7fe92b76aeeb26d4;p=civicrm-core.git CRM-17011 fix for smart group regression --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index a785c2e5f6..29f7dba93b 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -5205,6 +5205,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, } } else { + $op = 'IN'; $dragonPlace = $iAmAnIntentionalENoticeThatWarnsOfAProblemYouShouldReportUsingOldFormat; if (($queryString = CRM_Core_DAO::createSqlFilter($field, array($op => array_keys($value)), $dataType)) != FALSE) { return $queryString; diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 302b3a4d5a..d8aa06944c 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Member_BAO_Query { @@ -46,8 +44,6 @@ class CRM_Member_BAO_Query { * If membership are involved, add the specific membership fields * * @param $query - * - * @return void */ public static function select(&$query) { // if membership mode add membership id @@ -201,6 +197,12 @@ class CRM_Member_BAO_Query { $query->_tables['civicrm_membership'] = $query->_whereTables['civicrm_membership'] = 1; return; + // CRM-17011 These 2 variants appear in some smart groups saved at some time prior to 4.6.6. + case 'member_status_id': + case 'member_membership_type_id': + if (is_array($value)) { + $value = array('IN' => array_keys($value)); + } case 'membership_status': case 'membership_status_id': case 'membership_type':