From 4ca6e38f5f08e4ceea6a5ec564b1e09c5524c699 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 21 Dec 2020 16:07:46 +0100 Subject: [PATCH] FIX variant api code v13+ Better clean code --- htdocs/product/class/api_products.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index f7406692f8d..189161712d5 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1514,6 +1514,7 @@ class Products extends DolibarrApi foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); + $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]); } return $combinations; @@ -1547,6 +1548,7 @@ class Products extends DolibarrApi foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); + $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]); } return $combinations; @@ -1754,7 +1756,7 @@ class Products extends DolibarrApi unset($object->libelle); unset($object->product_id_already_linked); unset($object->reputations); - + unset($object->db); unset($object->name); unset($object->firstname); unset($object->lastname);