fix a warning in webhook trigger (#31850)

* fix a warnign in webhook trigger

* better fix

---------

Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Lucas Marcouiller 2024-11-15 16:44:57 +01:00 committed by GitHub
parent 3705d4a7ae
commit f80dd66ecc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,6 +76,9 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
$errors = 0;
$static_object = new Target($this->db);
$target_url = $static_object->fetchAll();
if (!is_array($target_url)) {
return 0;
}
foreach ($target_url as $key => $tmpobject) {
$actionarray = explode(",", $tmpobject->trigger_codes);
if ($tmpobject->status == Target::STATUS_VALIDATED && is_array($actionarray) && in_array($action, $actionarray)) {