webgriffe / SyliusAkeneoPlugin

Plugin allowing to import data from Akeneo PIM to your Sylius store.
https://webgriffe.github.io/SyliusAkeneoPlugin/
MIT License
23 stars 2 forks source link

[BUG] - Database error while creating products without name #148

Closed lruozzi9 closed 1 year ago

lruozzi9 commented 2 years ago

Describe the bug It could happen that, while importing products from Akeneo, the attribute used as the name for the product is empty. If this is the case, the importer will not generate any error because the name property on ProductTranslation is nullable. Still, when it tries to persist the product on DB it causes an Integrity constraint violation due to the not nullable constraint on the name column.

Expected behavior IMHO the plugin should check for the name consistency before trying to persist them on DB. If it is not valid it should throw a PHP exception so that it could be handled by the importer by marking the product as not imported without blocking the entire queue.

LucaGallinari commented 1 year ago

Here there are a couple of solutions that we can try: https://github.com/symfony/symfony/issues/35360#issuecomment-1016434075