From 1a08f65942da6cd9ff766a967fafad169d056d92 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 2 Sep 2015 17:22:19 +0200 Subject: [PATCH] Fix: problem with pagination --- htdocs/product/stock/replenish.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index efb008df4ff..5cf237050dd 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -57,6 +57,9 @@ $texte = ''; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); +if ($page == -1) { $page = 0; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; if (!$sortfield) { $sortfield = 'p.ref'; @@ -65,11 +68,6 @@ if (!$sortfield) { if (!$sortorder) { $sortorder = 'ASC'; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -// Force limit to no (currently solution to solve loosing selection when using pagination. No pagination on this page) -$limit = 0; /* @@ -309,7 +307,7 @@ if ($usevirtualstock) } $sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($limit, $offset); +$sql.= $db->plimit($limit + 1, $offset); //print $sql; $resql = $db->query($sql);