CRM-17011 fix for smart group regression
authoreileenmcnaugton <eileen@fuzion.co.nz>
Wed, 12 Aug 2015 00:12:56 +0000 (12:12 +1200)
committermonishdeb <monish.deb@webaccessglobal.com>
Wed, 12 Aug 2015 10:08:37 +0000 (15:38 +0530)
CRM/Contact/BAO/Query.php
CRM/Member/BAO/Query.php

index a785c2e5f65c2cadaab27c4818f471a69b974917..29f7dba93ba214e8a6f82c40367ebe5a3a288bfb 100644 (file)
@@ -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;
index 302b3a4d5abb9b263c0a76977fd7ecb45fa6f474..d8aa06944c5c794d387486a4cf810ee884348f77 100644 (file)
@@ -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':