From b329a9d8863ab96aa0b750725634b20f7f010f00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Sep 2020 12:45:09 +0200 Subject: [PATCH] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 9868835414a..1fda9bf3a22 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -877,6 +877,7 @@ class Products extends DolibarrApi /** * Get attributes. + * * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -920,12 +921,12 @@ class Products extends DolibarrApi $result = $this->db->query($sql); if (!$result) { - throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + throw new RestException(503, 'Error when retrieve product attribute list : '.$db->lasterror()); } $return = []; while ($result = $this->db->fetch_object($query)) { - $tmp = new stdClass(); + $tmp = new ProductAttribute($this->db); $tmp->id = $result->rowid; $tmp->ref = $result->ref; $tmp->ref_ext = $result->ref_ext;