-
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.3: "Use Default Value" gets unchecked for Multiple Attributes when updating with an API #32544
Comments
Hi @elaidomino. 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. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Might help to provide some example API calls and some specific product attributes that are affected |
Change your endpoint from /rest/V1/products/:sku (updates single storeId) This seems to be only reference I could find for all store code or async endpoint: or async bulk endpoint: |
I just came across the same issue in a Magento 2.2 shop, not sure how much the code changed in M2.4/2.3 for the consumer part. But as far as I can see looking through the code, there are no changes that could solve this issue between these versions so probably it's the same issue. After some research I came to the conclusion that for the shop I am working on it's due to the data caching in the ProductRepository class. If you first update the product async so the consumer will have an object in cache. Then keep the consumer running while saving a product through the backend. Then once you make any async changes the consumer will still be using the old product object and it's data. So all data set through the back-end will be reset. This occurs because the initializeProductData will use removeProductFromLocalCache to clear the cache, but that will only clear the sku array ($instances) and not the product product id array ($instancesById). So while retrieving the product it will fail to do so by sku cache, so it will lookup the id by sku and then still use the id cache. Hope this helps. FYI: We have seen similar results with other class caches like orders, stock, customers etc. when using consumers. In multiple projects. So the whole consumers and class caching should be investigated for multiple types. EDIT: Also it might be important to know that even if instancesById is cleared while removeProductFromLocalCache is being called before all this happens the save action will already retrieve the product earlier and set the product_links and status. So those might still be resetted in that case. So we now clear all the class caches through a beforeSave plugin. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @engcom-November. Thank you for working on this issue.
|
Hi @engcom-Delta. Thank you for working on this issue.
|
Hi @elaidomino, Thanks for raising the issue , We tried reproducing the issue but need more clarity on steps to reproduce it.
Thanks |
This sounds like a duplicate of #9186 (and #26484 and #31083 and probably some others), according to the latest comments in those threads the issue might have been fixed by 6a27b0c & 306f515 (both of which are not released yet, so maybe they are coming in Magento 2.4.3?), but it's not really confirmed I think, so I'm not 100% sure. @elaidomino: if you believe this is not a duplicate of those others, please leave some feedback 🙂 |
There has no update from 14 days ,hence closing it. Thanks |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: