fix CRM-12051
authorDonald A. Lobo <lobo@civicrm.org>
Thu, 7 Mar 2013 20:43:52 +0000 (12:43 -0800)
committerDonald A. Lobo <lobo@civicrm.org>
Thu, 7 Mar 2013 20:43:52 +0000 (12:43 -0800)
CRM/Contact/BAO/Query.php

index 6e4fef7a4146d840b19a628df69d2bae7485507d..689a180d66fdc896fb9fe03a6d447f59a6e68141 100644 (file)
@@ -1590,11 +1590,16 @@ class CRM_Contact_BAO_Query {
         }
         // check for both id and contact_id
         if ($this->_params[$id][0] == 'id' || $this->_params[$id][0] == 'contact_id') {
-          if ($this->_params[$id][1] == 'IS NULL' ||
+          if (
+            $this->_params[$id][1] == 'IS NULL' ||
             $this->_params[$id][1] == 'IS NOT NULL'
           ) {
             $this->_where[0][] = "contact_a.id {$this->_params[$id][1]}";
           }
+          elseif (is_array($this->_params[$id][2])) {
+            $idList = implode("','", $this->_params[$id][2]);
+            $this->_where[0][] = "contact_a.id IN ({$idList})";
+          }
           else {
             $this->_where[0][] = "contact_a.id {$this->_params[$id][1]} {$this->_params[$id][2]}";
           }