Integrity constraint : remove group in family attributes then recreate it
-
Hello, I recently had this bug while editing an attribute family.
How to reproduce :
- Edit an existing family
- Remove a group
- Create again a group with the same name (for instance : if you have deleted the wrong group and you want to recreate it)
- Save
Behavior :
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate field '1-Group' for the key 'attribute_groups_attribute_family_id_name_unique'
Expecting behavior :
I think you should verify if the record exists in the database before creating it. It is not a big deal for a programmer who will understand this error. But the end user may be confused.
+ This bug may exists in differents contexts...
Thanks!
-
Hi there,
you have to save it after delete then it will remove from the database.