This repository has been archived by the owner on Apr 29, 2019. It is now read-only.
Magento_ImportExport: Running multiple product imports after each other can create faulty duplicate sku's #47
Labels
Milestone
From @koenner01 on January 23, 2017 12:57
When running multiple product imports through the importExport module of Magento, duplicate sku's can be generated during the import process because of the SkuProcessor model being used as a singleton.
Preconditions
Steps to reproduce
As a test we are running an import with 100 products without their relations (related, upsell, crosssell) and then an import with the same 100 sku's but only with their relations.
Expected result
Actual result
I've traced this issue back to Magento\CatalogImportExport\Model\Import\Product instantiating it's skuProcessor through the constructor as a singleton. Because it is a singleton, the oldSkus on the skuProcessor object aren't being reloaded in between the imports.
Currently we are working around this by instantiating the skuProcessor in our custom Model constructor
And then in the for loop we reload the oldSkus by doing
Because the skuProcessor is being treated as a singleton, the oldSku's in Magento\CatalogImportExport\Model\Import\Product will be correct
Copied from original issue: magento/magento2#8235
The text was updated successfully, but these errors were encountered: