From 7997e927a03c51abbc7776c21b7dfc6f0500b5c9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 13 Feb 2025 14:59:15 +0100 Subject: [PATCH] fix: On Supplier Order create, if insertExtrafield failed, Dolibarr do not return error and continue --- htdocs/fourn/class/fournisseur.commande.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4f72be4c417..de27129124a 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1610,8 +1610,13 @@ class CommandeFournisseur extends CommonOrder // End call triggers } - $this->db->commit(); - return $this->id; + if (!$error) { + $this->db->commit(); + return $this->id; + } else { + $this->db->rollback(); + return -4; + } } else { $this->error = $this->db->lasterror(); $this->db->rollback();