Fix api product : rang is now position

This commit is contained in:
Maxime Kohlhaas 2022-10-22 15:32:54 +02:00
parent 89261d51e3
commit 2fa0e34b09

View File

@ -1014,7 +1014,7 @@ class Products extends DolibarrApi
throw new RestException(401);
}
$sql = "SELECT t.rowid, t.ref, t.ref_ext, t.label, t.rang, t.entity";
$sql = "SELECT t.rowid, t.ref, t.ref_ext, t.label, t.position, t.entity";
$sql .= " FROM ".$this->db->prefix()."product_attribute as t";
$sql .= ' WHERE t.entity IN ('.getEntity('product').')';
@ -1051,7 +1051,7 @@ class Products extends DolibarrApi
$tmp->ref = $result->ref;
$tmp->ref_ext = $result->ref_ext;
$tmp->label = $result->label;
$tmp->rang = $result->rang;
$tmp->position = $result->position;
$tmp->entity = $result->entity;
$return[] = $this->_cleanObjectDatas($tmp);
@ -1088,7 +1088,7 @@ class Products extends DolibarrApi
throw new RestException(404, "Product attribute not found");
}
$fields = ["id", "ref", "ref_ext", "label", "rang", "entity"];
$fields = ["id", "ref", "ref_ext", "label", "position", "entity"];
foreach ($prodattr as $field => $value) {
if (!in_array($field, $fields)) {