From: Cesar Velez Date: Thu, 4 Jan 2018 22:36:02 +0000 (-0500) Subject: LP#1739648 - fix item duplication in itemsout and holds grids X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4cdc7cd6e32942331e4403349fdd13ff1c88ec03;p=evergreen%2Fequinox.git LP#1739648 - fix item duplication in itemsout and holds grids Since these grids have caching, if the offset was greater the cached data length, the grid would try to fetch data again, even if it's already there, pushing duplicate items into the cache. This should prevent that. Signed-off by: Cesar Velez Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js index 41e0223308..6d017d4782 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js @@ -90,7 +90,7 @@ function($scope, $q, $routeParams, egCore, egUser, patronSvc, egCore.auth.token(), $scope.patron_id ).then(function(hold_ids) { - if (!hold_ids.length) { deferred.resolve(); return; } + if (!hold_ids.length || hold_ids.length < offset + 1) { deferred.resolve(); return; } patronSvc.hold_ids = hold_ids; fetchHolds(offset, count) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index 6679af6b1d..daf0041b5b 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -96,7 +96,7 @@ function($scope, $q, $routeParams, $timeout, egCore , egUser, patronSvc , $ $scope.gridDataProvider = provider; function fetch_circs(id_list, offset, count) { - if (!id_list.length) return $q.when(); + if (!id_list.length || id_list.length < offset + 1) return $q.when(); var deferred = $q.defer(); var rendered = 0;