CRM-12638, fixed group status
authorkurund <kurund@civicrm.org>
Tue, 27 Aug 2013 09:25:43 +0000 (14:55 +0530)
committerkurund <kurund@civicrm.org>
Tue, 27 Aug 2013 09:25:43 +0000 (14:55 +0530)
----------------------------------------
* CRM-12638: Optimize Prev/Next Cache and search interaction
  http://issues.civicrm.org/jira/browse/CRM-12638

CRM/Contact/BAO/Query.php

index 303d130dc01fee0854f9a723ee0c8aa8ff4d5f54..ba6a47d53438e36772ab4422082faa54c655d04b 100644 (file)
@@ -4388,12 +4388,13 @@ civicrm_relationship.start_date > {$today}
    */
   function getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds) {
     $this->_includeContactIds = $includeContactIds;
-    list($select, $from) = $this->query();
+    list($select, $from, $where) = $this->query();
     $from = " FROM civicrm_prevnext_cache pnc INNER JOIN civicrm_contact contact_a ON contact_a.id = pnc.entity_id1 AND pnc.cacheKey = '$cacheKey' " . substr($from, 31);
     $order = " ORDER BY pnc.id";
     $groupBy = " GROUP BY contact_a.id";
     $limit = " LIMIT $offset, $rowCount";
-    $query = "$select $from $groupBy $order $limit";
+    $query = "$select $from $where $groupBy $order $limit";
+
     return CRM_Core_DAO::executeQuery($query);
   }