Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-377

Cannot delete a taggable record (Taggable Extension)


    • 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:
    • Environment:
      PHP 5.3.1, Mac OS X (10.6), MySQL 5.0.86, Symfony 1.4.1


      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.


        fabienp Fabien Pennequin created issue -
        jwage Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            jwage Jonathan H. Wage
            fabienp Fabien Pennequin
          • Votes:
            1 Vote for this issue
            3 Start watching this issue


            • Created: