Ticket #672 (closed defect: fixed)
I18n update problem
| Reported by: | ysarazin | Owned by: | jwage |
|---|---|---|---|
| Priority: | major | Milestone: | 0.10.3 |
| Component: | Other | Version: | 0.10.0 |
| Severity: | Keywords: | I18n | |
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
I'm trying to update an I18n field, based on the Documentation examples :
Schema :
NewsItem:
tableName: news_item
actAs:
I18n:
fields: [title]
columns:
id:
notnull: true
primary: true
autoincrement: true
type: integer(11)
title:
type: string(200)
content:
type: string
Class:
abstract class BaseNewsItem extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('news_item');
$this->hasColumn('id', 'integer', 11, array (
'primary' => true,
'autoincrement' => true,
'notnull' => true,
));
$this->hasColumn('title', 'string', 200, array (
));
$this->hasColumn('content', 'string', null, array (
));
}
public function setUp()
{
$this->actAs('I18n', array (
'fields' =>
array (
0 => 'title',
),
));
}
}
(I've moved $this->actAs into the setUp() method)
and I've tried to run the following code :
$item = Doctrine_Query::create()->query('FROM NewsItem')->getFirst();
$item->Translation['EN']->title = 'New title';
$item->Translation->save();
And I get the following error :
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
Doctrine_Connection->exec('UPDATE news_item_translation SET title = ? WHERE id = ? AND lang = ?', array('New title'))
The arguments "id" and "lang" are not passed to the query
Change History
Note: See
TracTickets for help on using
tickets.