l3pp4rd/DoctrineExtensions — Issue #234: Translatable lookup_unique_idx error
Author: rodimus
Created: 2012-01-16 22:12:54+00:00
State: open

Hi,

I am using DoctrineExtensions master

try to persist new entity mapped with translatable.
entity.title - is one Translatable property

$entity = new SurveySection();
$entity->setSurvey($survey);

$repository = $this->getEntityManager()->getRepository('StofDoctrineExtensionsBundle:Translation');

$repository->translate($entity, 'title', 'en', 'my article de')
->translate($entity, 'title', 'es', 'content de')
->translate($entity, 'title', 'fr', 'my article ru')
->translate($entity, 'title', 'de', 'content ru')
;

$this->getEntityManager()->persist($entity);
$this->getEntityManager()->flush();

It fails with mysql error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'en-Application\SurveyBundle\Entity\SurveySection-6-title' for key 'lookup_unique_idx' (500 Internal Server Error)

Please help to resolve an issue.
Many thanks.