FIX check if $categories is not empty

This commit is contained in:
Regis Houssin 2021-09-21 16:31:07 +02:00
parent e3f3e01c21
commit 48ce3ea4d3

View File

@ -236,9 +236,11 @@ if ($action == 'update' && !empty($permissiontoadd)) {
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
$categories = GETPOST('categories', 'array'); $categories = GETPOST('categories', 'array');
if (!empty($categories)) {
$object->setCategories($categories); $object->setCategories($categories);
} }
} }
}
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
if (!$error) { if (!$error) {