diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 93536c21730..c62b90f1289 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1347,7 +1347,8 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { if (!$notrigger) { - $result = $this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); + $triggerPrefix = (empty($this->TRIGGER_PREFIX) ? strtoupper($this->element) : $this->TRIGGER_PREFIX); + $result = $this->call_trigger($triggerPrefix.'_ADD_CONTACT', $user); if ($result < 0) { $this->db->rollback(); return -1; @@ -1445,7 +1446,8 @@ abstract class CommonObject if (!$error && empty($notrigger)) { // Call trigger $this->context['contact_id'] = ((int) $rowid); - $result = $this->call_trigger(strtoupper($this->element).'_DELETE_CONTACT', $user); + $triggerPrefix = (empty($this->TRIGGER_PREFIX) ? strtoupper($this->element) : $this->TRIGGER_PREFIX); + $result = $this->call_trigger($triggerPrefix.'_DELETE_CONTACT', $user); if ($result < 0) { $error++; } @@ -2728,9 +2730,6 @@ abstract class CommonObject if (!$error && !$notrigger) { // Call triggers $triggerName = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX); - if (get_class($this) == 'Commande') { - $triggerName = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented - } $result = $this->call_trigger($triggerName.'_MODIFY', $user); if ($result < 0) { $error++; @@ -3245,9 +3244,6 @@ abstract class CommonObject // Call trigger $this->context = array('shippingmethodupdate' => 1); $triggerPrefix = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX); - if (get_class($this) == 'Commande') { - $triggerPrefix = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented - } $result = $this->call_trigger($triggerPrefix.'_MODIFY', $userused); if ($result < 0) { $error++;