Merge pull request #18785 from hregis/fix_warning_php8

FIX check if method exists instead in class
This commit is contained in:
Laurent Destailleur 2021-09-21 19:20:14 +02:00 committed by GitHub
commit c433d6ef4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 (method_exists($object, 'setCategories')) {
$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) {