Closed OvalMedia closed 3 years ago
Sorry, I forgot:
@OvalMedia I will look at this this week. Thank you for reporting this issue.
@OvalMedia I have reverted change that caused a problem https://github.com/lizardmedia/product-attachments-magento2/commit/676080293bfee87f8655ad372277301170d6c7d5. Please test it
Problem is gone. Thank you.
Hello, I'm still getting that error with 1.3.8 - the module allows duplicate pairs of attachment_id and store_id in the title table, and it does happen. I have put a constraint on these columns directly in database to not break my front anymore, and I'm adding checks to my own code to prevent these extra insertion attempts, but it still happens with store_id 0. It would be a good idea to add the constraint to the module itself, though.
It seems to happen more often if one tries to save the product through the entity manager.
When I try to save a product with an existing attachment I get this error:
Item (LizardMedia\ProductAttachment\Model\Attachment) with the same ID "195" already exists.
I cleaned all lizardmedia* tables to be sure everything is from scratch. I also removed all files in pub\media\downloadable\files\attachment.
Then I uploaded a PDF to an existing product which worked fine. But editing this product afterwards failed with the mentioned error.