From: Jon goldberg Date: Thu, 12 Mar 2015 03:42:28 +0000 (-0400) Subject: CRM-16056 - Core CiviCRM - Fix populating prev/next cache when jumping > 500 records... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5e2cd92a4af2241d4f594487fad6f9126889cdc9;p=civicrm-core.git CRM-16056 - Core CiviCRM - Fix populating prev/next cache when jumping > 500 records past the end of cache --- 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; }