Doctrine 1
  1. Doctrine 1
  2. DC-992

I18n - Translated fields are not deleted when record in master table is deleted

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Behaviors
    • Labels:
      None
    • Environment:
      Windows XP, xampp 1.7.3 (PHP 5.3.1)

      Description

      I have used I18n behavior for my application using the following:

      public function setTableDefinition()
      {
              $this->setTableName('products');
      
              $this->hasColumn('id', 'integer', 4, 
                  array('fixed' => true, 
                        'primary' => true, 
                        'autoincrement' => true));
      
              $this->hasColumn('permalink', 'string', 255,
                  array('notnull' => true));
              
              $this->hasColumn('title', 'string', 255, 
                  array('notnull' => true));
                  
              $this->hasColumn('teaser', 'string', 255, 
                  array('notnull' => true));
                  
              $this->hasColumn('content', 'clob', 32767);
      }
      
      public function setUp()
      {   
              $this->actAs('I18n', array(
                      'fields' => array('title', 'teaser', 'content')
                  )
              );
      }
      

      Doctrine has created two tables db named products and products_translation.

      Insert and update of the record is working fine but when i perform a deletion of a record, the record is deleted from the products table but the translations stored in products translation table are not deleted.

        Activity

        Hide
        Justinas added a comment -

        if you are not using transaction type tables like innoDB you need to set 'appLevelDelete' => TRUE option for I18n
        it's not documented feature as i found out.

        $this->actAs('I18n', array(
        'fields' => array('title', 'teaser', 'content'),
        'appLevelDelete' => TRUE,
        )
        );

        Show
        Justinas added a comment - if you are not using transaction type tables like innoDB you need to set 'appLevelDelete' => TRUE option for I18n it's not documented feature as i found out. $this->actAs('I18n', array( 'fields' => array('title', 'teaser', 'content'), 'appLevelDelete' => TRUE, ) );

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Thanasis Fotis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: