CRM-12638, use query instead of cache table if 'select all' option is uses
authorkurund <kurund@civicrm.org>
Tue, 27 Aug 2013 09:05:13 +0000 (14:35 +0530)
committerkurund <kurund@civicrm.org>
Tue, 27 Aug 2013 09:05:13 +0000 (14:35 +0530)
----------------------------------------
* CRM-12638: Optimize Prev/Next Cache and search interaction
  http://issues.civicrm.org/jira/browse/CRM-12638

CRM/Contact/Form/Task.php

index 936405cd73ed9599519a3e6b3a0660d4bf76a3ff..7fa929e57183fbc0cf8a0a4465b5190cf5a0a057 100644 (file)
@@ -155,12 +155,9 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
       $sortByCharacter = $form->get('sortByCharacter');
       $cacheKey = ($sortByCharacter && $sortByCharacter != 'all') ? "{$cacheKey}_alphabet" : $cacheKey;
 
-      if ($form->_action == CRM_Core_Action::COPY) {
-        $allCids[$cacheKey] = $form->getContactIds();
-      }
-      else {
-        $allCids = CRM_Core_BAO_PrevNextCache::getSelection($cacheKey, "getall");
-      }
+      // since we don't store all contacts in prevnextcache, when user selects "all" use query to retrieve contacts
+      // rather than prevnext cache table
+      $allCids[$cacheKey] = $form->getContactIds();
 
       $form->_contactIds = array();
       if ($useTable) {
@@ -305,7 +302,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
     if (!$queryOperator) {
       $queryOperator = 'AND';
     }
-    $dao = $selector->contactIDQuery($params, $this->_action, $sortID,
+    $dao = $selector->contactIDQuery($params, $this->_action, $sortID,
       CRM_Utils_Array::value('display_relationship_type', $fv),
       $queryOperator
     );