Skip to content

Updating a product through the API unchecks "Use Default Value" on a bunch of attributes #26484

Closed
@Zyles

Description

@Zyles

When you update a product. For example adding an image using the API. Which is totally unrelated to anything else, such as editing price.

The checkbox "Use Default Value" becomes unchecked on a bunch of attributes, such as price.

This turns into a problem when you want to edit the product later, update the price, or the description etc. and nothing happens. So you have to change store view scope to that particular store, check the box "Use Default Value" and save to be able to change the price.

This should not happen in the first place.

Preconditions (*)

  1. Magento 2.3.3
  2. 2 store views

Steps to reproduce (*)

  1. Create 2 store views
  2. Add a new product with a price
  3. Change store view on the product. You can see "Use Default Value" for price is checked.
  4. Update the product using the API, for example uploading an image
  5. View the product again and change store scope
  6. Notice the "Use Default Value" on price is now unchecked (amongst other attributes)

Expected result (*)

Checkbox "Use Default Value" should remain checked until a user actually unchecks it.

Actual result (*)

Checkbox "Use Default Value" unchecks itself when you update the product using the API for all store views.

Additional info

I just re-produced it on 2.4-dev.

Seems to be a problem with scopes.

In addition to the steps above, do the following:

  1. Stores > All Stores. Click "Main Website Store" and change "Default Store View" to the second store view

image

  1. Open "Default Store View" and change to status to disabled
  2. Go into product, select scope "Default store view" (first store) Click "Use Default Value" on everything. Save.
  3. Change store scope to second store view. Click "Use Default Value" on everything. Save.
  4. Change scope to second store view again. A bunch of "Use Default Value" are unchecked.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    CDIssue recommended for the contribution dayComponent: ApiUse with concrete module component label E.g. "Component: Api" + "Catalog"Component: CatalogFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: 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 passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.3.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions