From abf2875eba6730526ada886f93aa25900371ec3d Mon Sep 17 00:00:00 2001 From: LAURIER Alexis <19586755+AlexisLaurier@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:25:45 +0100 Subject: [PATCH] commande.class.php - move db->begin() into cloture A DB begin request was sent before executing the status guard. If the guard fails, we exited the method without closing it. And it will occur a bug to any further database operation. --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index fae2fefefaa..88ce1a6df9c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -742,11 +742,11 @@ class Commande extends CommonOrder if ($usercanclose) { - $this->db->begin(); if ($this->statut == self::STATUS_CLOSED) { return 0; } + $this->db->begin(); $now = dol_now();