From 483ea559f52c63bd12054a6ea8b4a435c4777403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Dec 2020 16:54:28 +0100 Subject: [PATCH] Fix warning #15823 --- htdocs/webservices/server_productorservice.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 473a720f46a..d35dc705b6f 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -536,7 +536,7 @@ function createProductOrService($authentication, $product) $newobject->stock_reel = isset($product['stock_real']) ? $product['stock_real'] : null; $newobject->pmp = isset($product['pmp']) ? $product['pmp'] : null; - $newobject->seuil_stock_alert = isset($product['stock_alert']) ? $product['stock_alert'] : null; + $newobject->seuil_stock_alerte = isset($product['stock_alert']) ? $product['stock_alert'] : null; $newobject->country_id = isset($product['country_id']) ? $product['country_id'] : 0; if (!empty($product['country_code'])) $newobject->country_id = getCountry($product['country_code'], 3); @@ -705,15 +705,15 @@ function updateProductOrService($authentication, $product) $newobject->barcode_type = $product['barcode_type']; } - $newobject->stock_reel = $product['stock_real']; - $newobject->pmp = $product['pmp']; - $newobject->seuil_stock_alert = $product['stock_alert']; + $newobject->stock_reel = isset($product['stock_real']) ? $product['stock_real'] : null; + $newobject->pmp = isset($product['pmp']) ? $product['pmp'] : null; + $newobject->seuil_stock_alerte = isset($product['stock_alert']) ? $product['stock_alert'] : null; - $newobject->country_id = $product['country_id']; - if ($product['country_code']) $newobject->country_id = getCountry($product['country_code'], 3); - $newobject->customcode = $product['customcode']; + $newobject->country_id = isset($product['country_id']) ? $product['country_id'] : 0; + if (!empty($product['country_code'])) $newobject->country_id = getCountry($product['country_code'], 3); + $newobject->customcode = isset($product['customcode']) ? $product['customcode'] : ''; - $newobject->canvas = $product['canvas']; + $newobject->canvas = isset($product['canvas']) ? $product['canvas'] : ''; $elementtype = 'product';