Update api_products.class.php

This commit is contained in:
Laurent Destailleur 2020-09-04 12:45:09 +02:00 committed by GitHub
parent e5633e07a2
commit b329a9d886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;