diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 4f5557279f4..82e4f0c96dd 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -321,7 +321,7 @@ class FormSetup */ public function addItemsFromParamsArray($params) { - if (!array($params)) { return false; } + if (!is_array($params) || empty($params)) { return false; } foreach ($params as $confKey => $param) { $this->addItemFromParams($confKey, $param); // todo manage error } diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index c9eb9043084..eeca8b77358 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -95,7 +95,7 @@ $setupnotempty = 0; // Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only $useFormSetup = 0; // Convert arrayofparameter into a formSetup object -if (!empty($arrayofparameters) && $useFormSetup && (float) DOL_VERSION >= 15) { +if ($useFormSetup && (float) DOL_VERSION >= 15) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; $formSetup = new FormSetup($db);