This commit is contained in:
Laurent Destailleur 2020-07-19 01:29:42 +02:00
parent 16d486e211
commit ee74740384

View File

@ -808,6 +808,7 @@ class Products extends DolibarrApi
foreach($product_fourn_list as $tmpobj) { foreach($product_fourn_list as $tmpobj) {
$this->_cleanObjectDatas($tmpobj); $this->_cleanObjectDatas($tmpobj);
} }
//var_dump($product_fourn_list->db);exit; //var_dump($product_fourn_list->db);exit;
$obj_ret[$obj->rowid] = $product_fourn_list; $obj_ret[$obj->rowid] = $product_fourn_list;
@ -863,11 +864,17 @@ class Products extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$product_fourn_list = array();
if ($result) { if ($result) {
$product_fourn = new ProductFournisseur($this->db); $product_fourn = new ProductFournisseur($this->db);
$product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0); $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0);
} }
foreach($product_fourn_list as $tmpobj) {
$this->_cleanObjectDatas($tmpobj);
}
return $this->_cleanObjectDatas($product_fourn_list); return $this->_cleanObjectDatas($product_fourn_list);
} }
@ -1585,6 +1592,8 @@ class Products extends DolibarrApi
// phpcs:enable // phpcs:enable
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
unset($object->db);
unset($object->regeximgext); unset($object->regeximgext);
unset($object->price_by_qty); unset($object->price_by_qty);
unset($object->prices_by_qty_id); unset($object->prices_by_qty_id);