Magento_ImportExport: Running multiple product imports after each other can create faulty duplicate sku's #8235
Labels
bug report
Component: ImportExport
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
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
The text was updated successfully, but these errors were encountered: