New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating a product through the API unchecks "Use Default Value" on a bunch of attributes #26484
Comments
Hi @Zyles. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @Zyles do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hello @Zyles, Unfortunately, we are not able to reproduce this issue.
The product is updated, image added. But when we switch between Store Views, the Use Default value checkboxes are still checked. We tried to reproduce with one Website and several, the result is the same, all checkboxes are checked. Can you please provide us with more info: the number of Websites and StoreViews, which API Client and query body you are using? Thank you for your contribution. |
Where is the text swatch? Look at the other store views. |
Oh sorry another issue. See if the effect happens if you do this: #26481 Could be related to the text swatch that unchecks the boxes. I also found this: https://community.magento.com/t5/Magento-2-x-Technical-Issues/quot-Use-Default-Values-quot-Checkbox-Unchecked-While-Update/td-p/137217 So can be related to |
That issue does not mention the "unchecking of use default value" problem. But it MAY be related to text swatch. Please confirm by testing with a text swatch with a default value on the product. |
Hello @Zyles We have tested Updating the product with Text Swatch attribute through the API. Rechecked with two API requests:
The Use Default Value checkboxes do not become unchecked on all Store Views This issue is not reproducible on Magento 2.4-develop, so we have to close it. Thank you for collaboration. |
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:
Please confirm. |
Please re-open this issue. |
I've the same issue on 2.3.3; after creating a product it's enough to send the empty payload {"product":{}} in PUT to /en/index.php/rest/<shop_code>/V1/products/ in order to uncheck all the "Use Default Value" attributes having scope "website" could you please double check? |
Thanks for opening this issue! |
✅ Confirmed by @engcom-Bravo Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
This has caused massive problems for us. When we update our product prices using the API, every single product has unchecked the "Use default" values. So that means everytime we edit a product, disable it etc. We have to do it on multiple storefronts because the values are no longer shared. |
We have exactly the same problem at the moment - but we are not using the API, we used the Import functionality and now... all our products are a huge mess and when saving a field in a store view, sometimes all the translations are kicked out without noticing. |
@domi-nique I tried to resolve the issue several times, but significant resources are necessary to solve it. If it is critical for you - you can assign your resources to resolve it - at least partially. |
Hi @engcom-Golf. Thank you for working on this issue.
|
Try below POST URL, it should solve the issue of unchecks "Use Default Value" rest/all/V1/products/{sku} |
How do you upload an image to this endpoint? |
POST is supposed to only create products, not update them. If you look at my previous post:
this is my (easy) way to reproduce the problem |
This might have been finally fixed: #31083 (comment) (not tested myself) |
Can not reproduce on 2.4-develop. This issue has been fixed in #31083. |
Hi @Zyles, @engcom-Golf. Thank you for your report and collaboration! The related internal Jira ticket The fix will be available with the upcoming |
@magento-engcom-team It occurs again in Magento 2.4.5. Adding new image via API to product cause uncheck checkboxes for 'Use default value' Request endpoint: /rest/en/V1/products/24-MB01/media |
what is the status for this issue that happens again on 2.4.5? |
@thomas-kl1 do you think we can use your fix in production, despite it didn't pass all tests? we urge to migrate from 2.4.3 to 2.4.5 because we're on php7.4 that is end of life. Thank you |
Hi @blacktek The fix helps with the loss of data when using the Magento webapi. I'm not sure we can rely on the tests as many of them are dumb tests that check the implementation instead of the expected result. |
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 (*)
Steps to reproduce (*)
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:
The text was updated successfully, but these errors were encountered: