-
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
Product images are being duplicated on import #26713
Product images are being duplicated on import #26713
Conversation
Hi @PieterCappelle. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hey @PieterCappelle thanks for putting this together. If I am not mistaken, the error here is that when an import with invalid entries goes through, it bugs out? |
@AddoSolutions No, at Magento 2.3 and 2.4 there is a issue when importing products with images. It's duplicating them instead of replacing them. If you import for the first time the image is added, if you re-run the import for the second time the image is not replaced but added (duplicated). |
Correct, that is the issue I was experiencing. My comment was in reference
to the error generated by the CI, and what it takes to get this bug fix
rolled out.
|
Thanks @PieterCappelle . I haven't tested this, but one testing scenario I think is useful to point out is the following: When changing image roles, i.e. Hide on product page or custom image attributes, even though the md5 hash of the image is the same, it should still update the roles. (There had been two other PRs for this same issue and one of them didn't do that.) |
@erfanimani You have links to those PR's? I can't find them immediately. Thanks! |
Ah I didn't realize you had linked them already. It's just #21146 and #21855 @PieterCappelle |
I had this same duplicate image issue and applied the changes to 2.3.3-p1. It fixed the issue, but introduced a new one. If you import the additional_images attribute column with more than one image URL, it results in only the first image being imported. |
Checking in on this, has this issue stalled? |
app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php
Outdated
Show resolved
Hide resolved
Hi @PieterCappelle, can you please look through the requested changes and fix falling tests? |
# Conflicts: # app/code/Magento/CatalogImportExport/Model/Import/Product.php
@PieterCappelle I'll try to continue with your PR. |
✔️ QA Passed Preconditions:
Import settings
Before: ✖️ Product images duplicated After: ✔️ Product images are not duplicated Case 2. Tested and with external links for images and everything works as expected Manual testing scenario:
Actual Result: ✔️ Product images are not duplicated Also, tested Replace and Delete functionalities and everything works as expected. |
@magento run all tests |
Hi @PieterCappelle, thank you for your contribution! |
After two years, we can stop patching this ourselves. Well done all — cause for celebration :) |
Nice!
Do you still have plans for this, or is a patch available? |
Product images are being duplicated on import magento#26713
Are the hashes re-calculated on each import? Or are they stored in the database? And how does this work with the S3 storage? Or am I overlooking something? |
hello
they are re-calculated
indeed
we don't have the case yet but may come later |
Description
Built on top of #21146 and #21855.
This PR adds image deletion so after import product will have images specified in the CSV. New images will be added, existing will not be duplicated and images not mentioned in the CSV will be removed. This PR has been created for 2.4-develop branch and when approved I'll create backport for 2.3 branch.
Fixed Issues
#14398: Images Not Replaced via CSV Import
#21885: Product images are being duplicated on import
Manual testing scenarios (*)