From 006c546a87fd63b09b53d2416879f242684a64e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Feb 2016 10:51:42 +0100 Subject: [PATCH] Fix select number of records in list --- htdocs/societe/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 19149d3fe3c..d263e37573e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -418,6 +418,8 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; +$sql.= $db->order($sortfield,$sortorder); + // Count total nb of records $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -426,7 +428,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } -$sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); @@ -815,7 +816,7 @@ if ($resql) $var=True; - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $var=!$var;