From 9646c9c8a3fe715cdca8608198ae6ae7c931f604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 15 Sep 2022 15:11:19 +0200 Subject: [PATCH] add debug to product massaction --- htdocs/product/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d24b4e0d12b..5382f231322 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -371,7 +371,9 @@ if (empty($reshook)) { foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); if ($result > 0 && $product->id > 0) { - $product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell'); + if ($product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell') < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } } } } @@ -380,7 +382,9 @@ if (empty($reshook)) { foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); if ($result > 0 && $product->id > 0) { - $product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy'); + if ($product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy') < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } } } }