From ec1658b95ad002cc696a05dc225f9f0a04328f18 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 20 Aug 2025 17:04:25 +0200 Subject: [PATCH] FIX #35008 --- htdocs/product/stock/product.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 2fa11c0b6e4..7ae6ffb7b71 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -89,6 +89,21 @@ if (!empty($batchnumber)) { } $cost_price = GETPOST('cost_price', 'alpha'); + +// Load variable for pagination +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + + // Security check if ($user->socid) { $socid = $user->socid;