From 05c07f0a996b4a110ef485bbcc99c1978e4ba0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20David?= Date: Thu, 12 Oct 2023 11:16:20 +0200 Subject: [PATCH] #3348 [Triggers] fix: triggers object fetch condition --- ..._99_modDigiriskdolibarr_DigiriskdolibarrTriggers.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/triggers/interface_99_modDigiriskdolibarr_DigiriskdolibarrTriggers.class.php b/core/triggers/interface_99_modDigiriskdolibarr_DigiriskdolibarrTriggers.class.php index 22a87ce0d..43228cac6 100644 --- a/core/triggers/interface_99_modDigiriskdolibarr_DigiriskdolibarrTriggers.class.php +++ b/core/triggers/interface_99_modDigiriskdolibarr_DigiriskdolibarrTriggers.class.php @@ -146,7 +146,9 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Trigger descriptions are handled by class function getTriggerDescription if (method_exists($object, 'getTriggerDescription')) { - $object->fetch($object->id); + if (strstr($action, '_CREATE')) { + $object->fetch($object->id); + } if (getDolGlobalInt('DIGIRISKDOLIBARR_ADVANCED_TRIGGER') && !empty($object->fields)) { $actioncomm->note_private = $object->getTriggerDescription($object); }