-
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
Saving product with non-default store scope causes untouched attributes to become store scoped if loaded using ProductRepository #8897
Comments
@phirunson, thank you for your report. |
This is also an issue when updating a product via the REST API in 2.1.19. When updating a product under a non-default store scope, all store scoped eav attributes are overridden, not just those that are being updated. This seems to be a major bug, and so should be addressed in 2.1.x and 2.2.x, no? |
This is still an issue in CE 2.2.1. If you save a product programmaticly without touching the attributes that have a default value in that store it will save those attributes with the value from the default value and thus unsetting the 'use default value' check |
We are also having this problem in 2.2.2 |
For the ones who have this issue. You will need to use the resourcemodel to post your own mysql queries to the database. No other solution that i have found |
We are using the api to update to product data so what you are saying is that we should trash the api Magento provides and create our own calls... |
I believe I have a related issue. For varchar attributes you set, there will be values for selected store_id (related to a website) and admin one, for varchar attributes with default values like media_images there will only be "no_selection" on a store level. So if you later upload an image on admin side on default scope, an image will not appear. One more problem is that you'll have to upload the image again on store view level because there is no "use default scope" checkbox in the images section. |
snippet of the wall of text from our cloud support ticket:
Break stuff through the backend:
The problem can be split into multiple origins:
Break stuff through the api:
I can't even wrap my head around this problem. |
Hello, Tried to reproduce the issue in the latest 2.4-develop branch by making a custom module. But it seems the issue is not reproducible for us. Please have a look at the below screenshot for reference: We are also attaching the module for reference: Please let us know if we have missed anything. Thanks |
Hey @engcom-Hotel Please take a look at your second screenshot. As you can see every single "Use Default Value" option is deselected. |
Which proofs that the issue is still reproducible in the latest 2.4-develop branch. |
Hello @MarianNapi @oneserv-heuser, I agree with you. Hence confirming this issue. Thanks |
❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-2904 |
What commits relate to this being completed? |
Looks like related changes are ed33a4e (found by ticket id that was mentioned in #8897 (comment)), but would be great to confirm it |
Pretty crazy that this big bug is not fixed yet. |
This is related to #7720 and #7879 and #9486
Preconditions
Steps to reproduce
Expected result
short_description
should be overridden, all other attributes should remain as Use default valueActual result
short_description
are copied over from the default store scope values.You can see the results of this by checking the
catalog_product_entity_text
table and seeing that new values for not justshort_description
, butdescription
andmeta_keyword
as well. Checking thecatalog_product_entity_{varchar,int,decimal,etc}
tables will also show new entries for store scope 2 even though none of that was modified.Checking the how the admin backend handles this, it seems the Save controller requires passing in values for whether to use default values in a param
use_default
. (https://github.com/magento/magento2/blob/develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L171)This makes it tightly coupled to the admin ui, and so it is hard to replicate proper save behaviour in code.
The use case is that products are being pushed externally via the Magento api, but this makes it so that doing store scoped save operations means anytime something is changed in default scope, it needs to also update in all store scopes independently rather than inheriting from default scope like it should.
The text was updated successfully, but these errors were encountered: