From ae7b31e71627f4206317be91a44427cd05b34668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Fri, 31 Mar 2023 17:31:20 -0400 Subject: [PATCH] Fix #24410 - No $resql overwrite --- htdocs/core/lib/functions2.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 2eda8cbbdcc..ce639624f1a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1936,14 +1936,14 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $sql .= " ORDER BY description DESC"; dol_syslog('/core/lib/function2.lib.php::getListOfModels', LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); + $resql_models = $db->query($sql); + if ($resql_models) { + $num = $db->num_rows($resql_models); $i = 0; while ($i < $num) { $found = 1; - $obj = $db->fetch_object($resql); + $obj = $db->fetch_object($resql_models); // If this generation module needs to scan a directory, then description field is filled // with the constant that contains list of directories to scan (COMPANY_ADDON_PDF_ODT_PATH, ...).