From 66ceb5d9c640766b002421c2623627bafd33b30d Mon Sep 17 00:00:00 2001 From: kurund Date: Tue, 27 Aug 2013 14:35:13 +0530 Subject: [PATCH] CRM-12638, use query instead of cache table if 'select all' option is uses ---------------------------------------- * CRM-12638: Optimize Prev/Next Cache and search interaction http://issues.civicrm.org/jira/browse/CRM-12638 --- CRM/Contact/Form/Task.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 936405cd73..7fa929e571 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -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 ); -- 2.25.1