ai-admin-jqadm
ai-admin-jqadm copied to clipboard
Accidently using the same article code twice leads to database error
Environment
- Version "aimeos/aimeos-typo3": "^18.4"
- Integration TYPO3 8.7.33
- System ddev on windows with php 7.2
Describe the bug Adding any article or article variant accidently wit an article number that is taken already leads to a database error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-product-P0Y1M0W0D-11' for key 'unq_msattr_sid_dom_cod_tid', /var/www/html/vendor/aimeos/aimeos-
Worse, when you accidentally use the same article number for a products variant as the product itself has the product becomes unsafeable. Even if you do change the article number of the erroneuous variant or delete the variant the product cannot be saved anymore. So all changes you made get lost. When going back to the product list and opening the product again it can be saved again, however all images, descriptions etc that where not saved are lost of course
To Reproduce create a product with article number test02 save it, saves fine add a text add a variant with article number test01 add a variant with article number test02 save it. error SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-product-P0Y1M0W0D-11' for key 'unq_msattr_sid_dom_cod_tid', /var/www/html/vendor/aimeos/aimeos- will apear rename the article number from test02 to test03 save it - same error. delete the variant test03 save it -same error go to the product list, open product test02. It has no texts and no variants. add variant test04, save it. saves fine.
Expected behavior An error message when a key is taken, preferably via ajax. after changing the key to one not taken product should save.
See also https://aimeos.org/help/post11567.html#p11567
Yes, this is still a problem and we have that on our list of improvements for the admin interface. We hope to add an XHR check in the background until the 2020.10 LTS release