From 5a3f78088e2c42fd763d6493a4143783164c42fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Thu, 21 Nov 2019 18:18:11 +0100 Subject: [PATCH] Fix double deleteAttributeValueByRef --- htdocs/product/class/api_products.class.php | 26 --------------------- 1 file changed, 26 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 32423c015fc..2fa4f600b11 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1262,32 +1262,6 @@ class Products extends DolibarrApi throw new RestException(500, "Error deleting attribute value"); } - /** - * Delete attribute value by ref. - * - * @param string $ref Ref of Attribute value - * @return int - * - * @throws RestException - * @throws 401 - * - * @url DELETE attributes/values/ref/{ref} - */ - public function deleteAttributeValueByRef($ref) - { - if(! DolibarrApiAccess::$user->rights->produit->supprimer) { - throw new RestException(401); - } - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '". trim($ref) ."'"; - - if ($this->db->query($sql)) { - return 1; - } - - throw new RestException(500, "Error deleting attribute value"); - } - /** * Get product variants. *