From 1dcb1a90656b909f51ff6106c814875d76e528b0 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 3 Apr 2014 14:33:01 +0000 Subject: [PATCH] Fix bug causing long task to fetch the same 200 ids repeatedly --- etemplate/js/et2_extension_nextmatch_actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch_actions.js b/etemplate/js/et2_extension_nextmatch_actions.js index 92b019eb16..65662fabd9 100644 --- a/etemplate/js/et2_extension_nextmatch_actions.js +++ b/etemplate/js/et2_extension_nextmatch_actions.js @@ -219,7 +219,7 @@ function nm_action(_action, _senders, _target, _ids) { var nextmatch = mgr.data.nextmatch; - if(nextmatch && nextmatch.controller && nextmatch.controller._grid &&nextmatch.controller._grid.getTotalCount() > idsArr.length) + if(nextmatch && nextmatch.controller && nextmatch.controller._grid && nextmatch.controller._grid.getTotalCount() > idsArr.length) { // Need to actually fetch all (TODO: just ids) to do this client side var idsArr = []; @@ -237,7 +237,7 @@ function nm_action(_action, _senders, _target, _ids) // dataFetch() is asyncronous, so all these requests just get fired off... // 200 rows chosen arbitrarily to reduce requests. do { - nextmatch.controller.dataFetch({start:idsArr.length, num_rows: 200}, function(data) { + nextmatch.controller.dataFetch({start:count, num_rows: 200}, function(data) { if(data && data.order) { for(var i = 0; i < data.order.length; i++)