Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProduct images are being duplicated on import #21885
Comments
This comment has been minimized.
This comment has been minimized.
Hi @simonworkhouse. 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. @simonworkhouse do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
This comment has been minimized.
This comment has been minimized.
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
This comment has been minimized.
This comment has been minimized.
@magento-engcom-team give me 2.3-develop instance |
This comment has been minimized.
This comment has been minimized.
Hi @dipti2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
This comment has been minimized.
This comment has been minimized.
Hi @dipti2jcommerce, here is your Magento instance. |
This comment has been minimized.
This comment has been minimized.
Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
This comment has been minimized.
This comment has been minimized.
I would like to share some point about the issue. It happens in Magento\CatalogImportExport\Model\Import\Product.php line 1772. If add a variable for exists images in mapper like _media_is_disabled, it should be fix it but the code try to match it with path. That why it doesn't work. |
This comment has been minimized.
This comment has been minimized.
Thank you for the information @tnsezer |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Actually, there's a better PR here, based on mine but it also deals with image deletion: #21855 |
This comment has been minimized.
This comment has been minimized.
@erfanimani thanks for the update. Are the issues duplicated or the PRs? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am working on this at #dmcdindia1 |
This comment has been minimized.
This comment has been minimized.
@soundararajanm1990 thank you for joining. Please accept team invitation here and self-assign the issue. |
This comment has been minimized.
This comment has been minimized.
Hi @soundararajanm1990. Thank you for working on this issue.
|
This comment has been minimized.
This comment has been minimized.
Have you fixed this issue? its also coming when trying to Duplicate product. Thanks |
This comment has been minimized.
This comment has been minimized.
what's the status on this issue? |
This comment has been minimized.
This comment has been minimized.
We can't solve this issue. Still now pending. |
This comment has been minimized.
This comment has been minimized.
We are encountering this too and since the import is ran daily this really clutters up the media gallery. Is there any workaround anyone can recommend? |
This comment has been minimized.
This comment has been minimized.
I have same problem, magento2.3.2 duplicated images after import product csv. Did you find a solution ? |
This comment has been minimized.
This comment has been minimized.
Two workarounds exist, scroll up to see the relevant pull requests/commits. You'll need a developer to create and apply Composer patches for your Magento version. Seems Magento is too busy to review/merge and fix the bug themselves though.. |
This comment has been minimized.
This comment has been minimized.
@erfanimani Yes, we indeed used a combination of the solutions (with some minor edits). Really odd that Magento doesn't look at the fixes because the importer is a vital part of most webshops. |
This comment has been minimized.
This comment has been minimized.
Thank you @erfanimani With a combination of the solutions, the import works very well. |
This comment has been minimized.
This comment has been minimized.
+1 Hoping to see this merged in soon, big help this :) |
This comment has been minimized.
This comment has been minimized.
Wow same trouble for us... This is awsome magento let this kind of BUG in a 2.3.2 version released worldwild... |
This comment has been minimized.
This comment has been minimized.
@kevinvuillemin can you share the working solution ? I'm strugeling with all the PR closed and open speaking around it. Thank you in advance |
This comment has been minimized.
This comment has been minimized.
@skapin, of course ! how do you want me to share the file? |
This comment has been minimized.
This comment has been minimized.
@kevinvuillemin you can send me a mail to skapinthefourb gmailcom address for example, or create a repository As you want. Thank you so much :) |
This comment has been minimized.
This comment has been minimized.
@skapin that's good for you ? https://gist.github.com/kevinvuillemin/802cc5e4b476e73c1c5838b143bd6a51 |
This comment has been minimized.
This comment has been minimized.
@kevinvuillemin It works on the first try. Copy/paste instead of Product.php and voila ! |
This comment has been minimized.
This comment has been minimized.
Et voila ! |
This comment has been minimized.
This comment has been minimized.
@kevinvuillemin Your code not working in Magento version : 2.3.1 |
This comment has been minimized.
This comment has been minimized.
Working with 2.3.2 for me, are you sure ? |
This comment has been minimized.
This comment has been minimized.
yes we used 2.3.1 not working |
This comment has been minimized.
This comment has been minimized.
@soundararajanm1990 I think they have changed the Product.php class for the release of Magento 2.3.2. The easier is to upgrade (maintenance & safety) |
This comment has been minimized.
This comment has been minimized.
@kevinvuillemin They moved the issue #14398 onto a new phase - does this mean your PR is ready for Testing on the next Dev version? |
This comment has been minimized.
This comment has been minimized.
any update on this issue? |
This comment has been minimized.
This comment has been minimized.
Below is a more permanent solution. Be careful, this will trash previous duplicates if there were any. Make a preference on
|
This comment has been minimized.
This comment has been minimized.
Well sadly this looks like it missed the 2.3.3 ship :( |
This comment has been minimized.
This comment has been minimized.
Realy ? That’s not cool. But This fix working ? : https://gist.github.com/kevinvuillemin/802cc5e4b476e73c1c5838b143bd6a51 |
This comment has been minimized.
This comment has been minimized.
Normally I would be surprised that it has been so long without a resolution, but I have come to expect this from Magento. Anyway, I have had to resolve this issue for a project recently and it appears that the offending commit was 7803eed I worked around this by adding a preference for a class that extends This addresses the issue in our specific use case, but it does not address the underlying issues with the way that images are managed in Magento. Additionally, it will also undo whatever "fix" that commit was attempting to do. |
When importing product data the product images are being duplicated for each import run.
Preconditions
Steps to reproduce
<install dir>
<install dir>
test-1.jpg
,test-2.jpg
,test-3.jpg
andtest-4.jpg
inside the path<install dir>/var/import-images
. Any valid jpeg will do.Import settings
__EMPTY__VALUE__
(default)Expected result
Products end up with each product image only attached once.
Actual result
Products end up with all product images duplicated.