SyliusImportExportPlugin icon indicating copy to clipboard operation
SyliusImportExportPlugin copied to clipboard

Cant import two products with the same name

Open TalkMarc opened this issue 1 year ago • 2 comments

When importing multiple products with the same name, the slug generator generates duplicate product slugs, which causes a unique constraint violation to trigger: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'en-foo-bar' for key 'UNIQ_105A9084180C698989D9B62

As a workaround, it might make sense for the slug to also be imported and exported.

TalkMarc avatar Sep 10 '24 10:09 TalkMarc

Hello @TalkMarc

You can see at https://github.com/FriendsOfSylius/SyliusImportExportPlugin/blame/9ada150500b56f7baae9e9861fe40ab2852c4e9d/src/Processor/ProductProcessor.php#L252 I think you can decorate this code and use some data from your file.

Regards

oallain avatar Sep 14 '24 16:09 oallain

Thank you for the message. Yes, i did end up copying and modifying the ProductProcessor and adding the slug to the imported columns so i could define it manually in the import file.

TalkMarc avatar Sep 23 '24 12:09 TalkMarc