Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0, 1.2.1
-
Fix Version/s: 1.2.2
-
Component/s: Extensions
-
Labels:None
-
Environment:PHP 5.3.1, Mac OS X (10.6), MySQL 5.0.86, Symfony 1.4.1
Description
With Taggable extension, when I try to delete a record using Taggable, I get this exception :
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`sf_sandbox/article_taggable_tag`, CONSTRAINT `article_taggable_tag_id_article_id` FOREIGN KEY (`id`) REFERENCES `article` (`id`))
If I check the sql queries generated by Doctrine, there are not "onDelete CASCADE" for one of relation added by Taggable extension.
I have write some test cases for reproduce this bug (checking if relation has a property onDelete setted to CASCADE) but I can't reproduce the thrown exception in test case because sqlite omits queries with constraint. Also, I found how to fix this bug.
The fix and test cases are available in the file attached to this ticket.
Hi Jon-
Where can I find this fix?
http://svn.doctrine-project.org/extensions/Taggable/branches/1.2-1.0 (the link referenced from the docs at http://www.doctrine-project.org/extension/Taggable) doesn't have this fix.