-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magento 2 REST API - Updating a single category also updates other attributes to not use the default value #39498
Comments
Hi @JoryHogeveen. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @JoryHogeveen @engcom-Bravo, I have tried reproducing the issue on the magento 2.4.7-p3 but the issue is not reproduceable to me. I have changed the value for the description for the specific product on store level. the description value was updated successfully and overwritten the default value. But the other product attributes were still selected as set to default value. Please check the screenshots below and correct me if i am wrong or provide me some additional details to reproduce the issue. Updated value of description at store level Product name and other attributes are still selected to use default value and unchanged. |
@bharatkumawaty7 |
I have tried with the different store view code as well but it seems working fine. Please check here with attached screenshots. |
Hi @bharatkumawaty7 My REST workflow was as follows:
I could reproduce this consistently, hence the bug report, and now I cannot anymore. Everything was done through the REST API. It might be relevant to mention that I did do a rebuild in the meantime and the cache and indexes are also refreshed several times since this report. I wouldn't expect cache or indexes giving troubles here since they didn't mention a refresh requirement + the current situation is still that the default values are overridden. I also didn't do a composer update so the lock file should still install the same package versions. I've already prepared a SQL script to remove all EAV overrides that have the same value as the default storecode (https://gist.github.com/JoryHogeveen/7aa4fa8a859cb030319cd300cbc745b6). Can you think of any reason why the initial issue occurred? Thank you again for taking the time to look into this topic. |
Preconditions and environment
I've already posted this on StackExchange:
https://magento.stackexchange.com/questions/375887/magento-2-rest-api-updating-a-single-category-also-updates-other-attributes-to
Due to the nature of this issue I really think it's a bug. And if not, an documentation issue.
Steps to reproduce
Expected result
The API should only update the data you send to it.
Actual result
The API updates a lot of other attributes like name, visibility etc.
Even though this will update that particular attribute just fine, it will also set several other attributes to overwrite the default value.
See example return under additional information. All attributes seen in the response below are not set to default anymore. Note that many other attributes, also store-view attributes among them like "page_layout", are still set to default...
I have no explanation as to why some attributes are switched to not use the default anymore and some others are not. Hope someone can help me with this as I am totally lost after hours of testing.
Additional information
API request:
POST: /store_view_code/V1/products/
API response:
Release note
I've set this to severity S0 as with the current state it will override important attributes like visibility, status and name without intent. This can create big issues on live instances where users could suddenly see hidden products in the catalog or even products with incorrect data.
Triage and priority
The text was updated successfully, but these errors were encountered: