Details
-
Type:
Bug
-
Status:
Open
-
Priority:
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.
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,
)
);