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,7 +236,9 @@ if ($action == 'update' && !empty($permissiontoadd)) {
if ($conf->categorie->enabled) {
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
if (method_exists($object, 'setCategories')) {
$object->setCategories($categories);
}
}
}