From ba94bc146f19e2019d33fcb2c91e580bffb552c8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 11 Oct 2022 10:00:23 +0200 Subject: [PATCH] FIX: supplier price update: missing error reporting --- htdocs/fourn/class/fournisseur.product.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index ea5dc639a5e..ca557e027dc 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -419,7 +419,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } @@ -506,6 +510,7 @@ class ProductFournisseur extends Product if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); } else { + $this->error = $this->db->lasterror(); $error++; } @@ -518,7 +523,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } }