diff --git a/htdocs/webportal/admin/setup.php b/htdocs/webportal/admin/setup.php index 48a3f73e2a4..7680e08cd9a 100644 --- a/htdocs/webportal/admin/setup.php +++ b/htdocs/webportal/admin/setup.php @@ -1,6 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -146,18 +147,16 @@ if ($action == 'updateMask') { // Search template files $file = ''; $classname = ''; - $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $file = dol_buildpath($reldir . "core/modules/webportal/doc/pdf_" . $modele . "_" . strtolower($tmpobjectkey) . ".modules.php", 0); if (file_exists($file)) { - $filefound = 1; $classname = "pdf_" . $modele . "_" . strtolower($tmpobjectkey); break; } } - if ($filefound) { + if ($classname !== '') { require_once $file; $module = new $classname($db);