From 65e49ebf78884d4c3e0fb20aff349bdcfe8b85b6 Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Thu, 16 Jun 2016 17:30:55 -0400 Subject: [PATCH] CRM-17616 - Moving to an arbitrary search page result could lead to incomplete results --- CRM/Contact/Selector.php | 6 +++--- js/crm.searchForm.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 0bad88963b..10c3189d3a 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -901,10 +901,10 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se // $sortByCharacter triggers a refresh in the prevNext cache if ($sortByCharacter && $sortByCharacter != 'all') { $cacheKey .= "_alphabet"; - $this->fillupPrevNextCache($sort, $cacheKey); + $this->fillupPrevNextCache($sort, $cacheKey, 0, max(500, $pageSize)); } - elseif ($firstRecord >= $countRow) { - $this->fillupPrevNextCache($sort, $cacheKey, $countRow, 500 + $firstRecord - $countRow); + elseif (($firstRecord + $pageSize) >= $countRow) { + $this->fillupPrevNextCache($sort, $cacheKey, $countRow, max(500, $pageSize) + $firstRecord - $countRow); } return $cacheKey; } diff --git a/js/crm.searchForm.js b/js/crm.searchForm.js index 785ae15afe..42a371dcec 100644 --- a/js/crm.searchForm.js +++ b/js/crm.searchForm.js @@ -63,13 +63,13 @@ params.name = $('input.select-row').map(function() {return $(this).attr('id');}).get().join('-'); } } - $.getJSON(url, params, function(data) { + $.post(url, params, function(data) { if (data && data.getCount !== undefined) { selected = data.getCount; displayCount(); enableTaskMenu(); } - }); + }, 'json'); } /** -- 2.25.1