From 38a45d594faac5eee71eb9c1282b0ba8d816512d Mon Sep 17 00:00:00 2001 From: Lars Dieckow Date: Wed, 26 Jun 2013 15:35:14 +0200 Subject: [PATCH] skip offset calculation if pagination is disabled --- lib/NGCP/Panel/Controller/Root.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Root.pm b/lib/NGCP/Panel/Controller/Root.pm index 6fc7db4aa0..691c7b1e3b 100644 --- a/lib/NGCP/Panel/Controller/Root.pm +++ b/lib/NGCP/Panel/Controller/Root.pm @@ -134,13 +134,12 @@ sub ajax_process_resultset :Private { } #Pagination - if (defined($iDisplayStart) && $iDisplayLength) { - $rs = $rs->search( - undef, - { - offset => $iDisplayStart, - rows => $iDisplayLength, - }); + # $iDisplayLength will be -1 if bPaginate is false + if (defined $iDisplayStart && $iDisplayLength && $iDisplayLength > 0) { + $rs = $rs->search(undef, { + offset => $iDisplayStart, + rows => $iDisplayLength, + }); } for my $row ($rs->all) {