From 89dda279a0beed2563aa8c3902fbe0fc933d1092 Mon Sep 17 00:00:00 2001 From: Bradley Jarvis Date: Fri, 12 Sep 2025 10:49:58 +1000 Subject: [PATCH] FIX: setShippingMethod tigger throwing error (#35320) * FIX: setShippingMethod tigger throwing error * Update commonobject.class.php --------- Co-authored-by: brad Co-authored-by: Laurent Destailleur --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 322f5539ffd..26fab7f5286 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3240,7 +3240,11 @@ abstract class CommonObject if (!$notrigger) { // Call trigger $this->context = array('shippingmethodupdate' => 1); - $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $userused); + $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++; }