CRM-17616 - Moving to an arbitrary search page result could lead to incomplete results
authorSamuel Vanhove <samuel@symbiotic.coop>
Thu, 16 Jun 2016 21:30:55 +0000 (17:30 -0400)
committerJohn Kirk <john@civifirst.com>
Fri, 14 Oct 2016 21:13:21 +0000 (21:13 +0000)
CRM/Contact/Selector.php
js/crm.searchForm.js

index 0bad88963bc3e6796562d0ff2ee856788de0f265..10c3189d3a79dd965e01aed1426b5be89355e6a3 100644 (file)
@@ -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;
   }
index 785ae15afe4e2721548bb1fb8567f057ce960614..42a371dcecf42d18e90d97dae3038d2992d098b7 100644 (file)
         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');
   }
 
   /**