From 1bc8c57d6d2486d5f3919bf12dc5ff5204968f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Thu, 21 Nov 2019 22:54:13 +0100 Subject: [PATCH] Fix $weight_impact $price_impact --- htdocs/product/class/api_products.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2fa4f600b11..bb83630bb72 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1347,9 +1347,12 @@ class Products extends DolibarrApi throw new RestException(401); } - if (empty($id) || empty($weight_impact) || empty($price_impact) || empty($features) || !is_array($features)) { + if (empty($id) || empty($features) || !is_array($features)) { throw new RestException(401); } + + $weight_impact = price2num($weight_impact); + $price_impact = price2num($price_impact); $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db); @@ -1406,9 +1409,12 @@ class Products extends DolibarrApi throw new RestException(401); } - if (empty($ref) || empty($weight_impact) || empty($price_impact) || empty($features) || !is_array($features)) { + if (empty($ref) || empty($features) || !is_array($features)) { throw new RestException(401); } + + $weight_impact = price2num($weight_impact); + $price_impact = price2num($price_impact); $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db);