Hello,
I have a problem today when I try to save a form with two i18n embed
forms.
# Context :
symfony : 1.3.0-DEV
php: 5.2.6-3ubuntu4.2
SERVER_SOFTWARE: 'Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with
Suhosin-Patch'
os: 'Linux tux 2.6.28-16-generic #55-Ubuntu SMP Tue Oct 20 19:48:24
UTC 2009 i686'
# The error message :
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'4-fr' for key 1
# Submited data to that form (parameter of bindAndSave) :
Array
(
[en] => Array
(
[name] => Nom_en
)
[fr] => Array
(
[name] => Nom_fr
)
[id] => 4
)
# When I'm looking in the save process, I noticed that the object take
theses values just after the doUpdateObject method (sfFormDoctrine,
line 129):
Array
(
[id] => 4
[created_at] => 2009-10-26 15:34:11
[updated_at] => 2009-10-28 10:06:26
[Translation] => Array
(
[en] => Array
(
[id] => 4
[name] =>
[lang] => en
)
[fr] => Array
(
[id] => 4
[name] =>
[lang] => fr
)
[fr_FR] => Array
(
[id] => 4
[name] =>
[lang] => fr_FR
)
)
)
Two problems :
1. Why fr_FR array appears ?
2. Why traduction (name) are empty ?
# The form declaration :
classTotoForm extends BaseTotoForm
{
public function configure()
{
$this->embedI18n(array('en', 'fr'));
}
}
# The object declaration in the schema.yml
Toto:
actAs:
Timestampable:
I18n:
fields: [name]
columns:
name: string(255)
---
thanks for your support.
Cordialy,
David BOUCHÉ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---