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 1/3] 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(); From 8d13e9231fe319dd09ed2b26a06c9319178caa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 15:05:32 +0100 Subject: [PATCH 2/3] remove debug --- htdocs/loan/schedule.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 5e27a48fa02..b9e6783ceca 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -48,7 +48,9 @@ $object->fetch($loanid); $echeances = new LoanSchedule($db); $echeances->fetchAll($object->id); -if ($object->paid > 0 && count($echeances->lines) == 0) $pay_without_schedule = 1; +if ($object->paid > 0 && count($echeances->lines) == 0) { + $pay_without_schedule = 1; +} /* * Actions @@ -86,8 +88,9 @@ if ($action == 'createecheancier' && empty($pay_without_schedule)) { $echeances->lines[] = $new_echeance; $i++; } - var_dump($result); - if ($result > 0) $db->commit(); + if ($result > 0) { + $db->commit(); + } } if ($action == 'updateecheancier' && empty($pay_without_schedule)) { From 07668167f6219cbed7b693b966d3cc4800277a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 15:18:07 +0100 Subject: [PATCH 3/3] Update card.php --- htdocs/intracommreport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 077f793d649..0226848bd48 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/intracommreport/class/intracommreport.class.php'; $langs->loadLangs(array("intracommreport")); -var_dump($_POST); + $action = GETPOST('action'); $exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB ou DES $year = GETPOSTINT('year');