magento2: Duplicate product is not copying all stores data
Preconditions (*)
- Tested on Magento 2.4.2
- The website has multiple stores (for different languages)
- Have a product with different data on each store
Steps to reproduce (*)
- Open the product, change to a different store
- Duplicate the product
Expected result (*)
- The new product will have the previously selected store data as it’s default data
- The duplicated product will have duplicate data from all other stores (for example texts in DE, EN, IT, FR)
Actual result (*)
- The duplicated product will have the previously selected store data as it’s default data
- The duplicated product will not have data from the rest of the stores, only default
This bug was introduced in https://github.com/magento/magento2/issues/26054, specifically on commit https://github.com/magento/magento2/commit/1f96b873283229aa6892444244475d9992c0d8f2
In there, on top of clearing the metadata (instead of respecting the user configuration, they also removed the lines that copy the attributes for the rest of the store views
$product->getResource()->duplicate(
$product->getData($metadata->getLinkField()),
$duplicate->getData($metadata->getLinkField())
);
so info not in default is lost and must be copied again (a clear problem with 8 stores). Those lines should be reinstated and the tests should also check that multiple store view are copied correctly. Of course, in this case the other stores would still keep the original meta attributes since only default is being cleared out, voiding the fix of that ticket. In that case, it would be better to pass an exclude list into the duplicate call (but it should be a decision of the user, #26504 makes an assumption that I want to rewrite the SEO data instead of only updating it before saving)
I think this is also related with the last reports on https://github.com/magento/magento2/issues/15656, but the original problem from that ticket was already resolved.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 9
- Comments: 20 (1 by maintainers)
Unfortunately it is on 2.4