From c852aa346adf6e6ebe0fdde5480900b3bf7282eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Feb 2026 21:38:51 +0100 Subject: [PATCH] Fix the limit --- htdocs/core/lib/company.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index db4f500f60a..2d61954f384 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2146,6 +2146,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr // TODO Add navigation with this limits by replacing call of show_actions_done by the code found into comm/action/list.php... $offset = 0; $limit = $MAXWITHOUTPAGINATION; + $num = 0; // Complete request and execute it with limit $sql .= $db->order($sortfield_new, $sortorder); @@ -2372,13 +2373,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $counter = 0; foreach ($histo as $key => $value) { - $counter++; - if ($counter > $MAXWITHOUTPAGINATION) { - $langs->load("errors"); - $colspan = 9; - $out .= '' . $langs->trans("WarningTooManyDataPleaseUseMoreFilters", $MAXWITHOUTPAGINATION) . ''; - break; - } $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo if (empty($actionstatic->code)) { @@ -2607,6 +2601,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $out .= '' . $langs->trans("NoRecordFound") . ''; } + if ($num > $MAXWITHOUTPAGINATION) { + $langs->load("errors"); + $colspan = 9; + $out .= '' . $langs->trans("WarningTooManyDataPleaseUseMoreFilters", $MAXWITHOUTPAGINATION) . ''; + } + $out .= "\n"; $out .= "\n";