Add a error log but does not block if trigger name is wrong

This commit is contained in:
ldestailleur
2025-10-03 11:27:39 +02:00
parent 16ee8858b4
commit 6a009f95dc

View File

@@ -87,8 +87,9 @@ trait CommonTrigger
if (!empty($this->TRIGGER_PREFIX) && strpos($triggerName, $this->TRIGGER_PREFIX . '_') !== 0) {
if (!preg_match('/^OBJECT_LINK/', $triggerName) && !preg_match('/^PAYMENTONLINE_/', $triggerName)) { // We add this exception as we have some call_trigger with a triggeName that is not the business object (as in method inside the commonobjet.class.php to manage links)
dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . $this->TRIGGER_PREFIX . '_" as required.');
exit;
dol_syslog('The trigger "' . $triggerName . '" does not start with "' . $this->TRIGGER_PREFIX . '_" as required.', LOG_ERROR);
//dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . $this->TRIGGER_PREFIX . '_" as required.');
//exit;
}
}
if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers().