From b9039eea143f5004fc9145554923b45e5570fa87 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 27 Aug 2021 10:45:04 +0200 Subject: [PATCH] FIx warehouse limit testing --- htdocs/commande/class/api_orders.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index ca49b426a87..2510e793018 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -1043,6 +1043,9 @@ class Orders extends DolibarrApi if (!DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } + if ($warehouse_id <= 0) { + throw new RestException(404, 'Warehouse not found'); + } $result = $this->commande->fetch($id); if (!$result) { throw new RestException(404, 'Order not found');