Skip to content

REST API: Cannot delete custom attribute from product #10807

@siliconalchemy

Description

@siliconalchemy

Cannot delete an existing product custom attribute through the rest API.

Preconditions

  1. Magento CE 2.1.8
  2. PHP 5.6.31

Steps to reproduce

  1. Have a custom attribute with an assigned value in a product
  2. PUT product update (/rest/all/V1/products/100030774) with custom attributes altered by either by assigning custom_attribute value None or removing the key/value

Expected result

  1. Expect for the custom attribute to be removed/deleted from the product custom_attribute list

Actual result

  1. Product doesn't remove/delete. If value is assigned None/Null, I get this error:
Updating product: 100030774: Put Error: Error occurred during "custom_attributes" processing. Value is not set for attribute code "fridge_capacity" Error updating product:  HTTPError('400 Client Error: Bad Request',)

If key/value is removed from the custom_attributes, then the Put call goes through without error, but the key/value is still present within custom_attributes, unaltered.

All other values update using exactly the same mechanism/code without issue, can add/change custom attributes correctly. Just cannot delete the custom attributes.

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions