-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Synchronise store attributes if attribute scope is website #38311
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @simsComputing. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
This pull request aims at fixing [https://github.com//issues/38243](this issue).
It fixes the synchronisation of a website scoped attribute in a multi store environment.
Description (*)
I fixed the issue by applying another condition in the _updateAttribute method of the Magento\Catalog\Model\ResourceModel\AbstractResource class.
A fix made recently on this method brought the bug. This method used to only call the _saveAttributeValue method of that same class. Now it has its own logic is the updated attribute is not new. I added a condition that the updated attribute must not be website scoped in a multi store environment.
I did not want to add too much code since the modificatoins that were made on this method took place for a specific reason that i do not know.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Adapt the sku and the store id to you use case.
Questions or comments
It doesn't seem i could write an automated test for this use case. Do you confirm ?
I took time to choose the right approach. I could not rollback the changes that were made on the issue at the origin of this bug even though the code written did not take into account the scope of the attribute.
So i decided to treat only the very issue I was working on. I had to make so that previous work would still be present and this issue would be fixed.
I hope you agree with that approach.
Contribution checklist (*)