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'); + } } } }