From 5e2cd92a4af2241d4f594487fad6f9126889cdc9 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Wed, 11 Mar 2015 23:42:28 -0400 Subject: [PATCH] CRM-16056 - Core CiviCRM - Fix populating prev/next cache when jumping > 500 records past the end of cache --- CRM/Contact/Selector.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 94cd3c49ae..37c7d3e92f 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -884,14 +884,13 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se //for text field pagination selection save $countRow = CRM_Core_BAO_PrevNextCache::getCount($cacheKey, NULL, "entity_table = 'civicrm_contact'"); - // $sortByCharacter triggers a refresh in the prevNext cache if ($sortByCharacter && $sortByCharacter != 'all') { $cacheKey .= "_alphabet"; $this->fillupPrevNextCache($sort, $cacheKey); } elseif ($firstRecord >= $countRow) { - $this->fillupPrevNextCache($sort, $cacheKey, $countRow, 500); + $this->fillupPrevNextCache($sort, $cacheKey, $countRow, 500 + $firstRecord - $countRow); } return $cacheKey; } -- 2.25.1