2

I'm using gedmo/doctrine-translations and a2lix/translation-form-bundle: 2.*@dev to translate my entities.

The translation form always renders a Field and Content but my entity itself doesn't contain a Field or Content field.

The form type

$builder->add('translations', 'a2lix_translations');
Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
Mauro
  • 1,447
  • 1
  • 26
  • 46
  • the constructor comes from the https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md#personal-translations. I don't have any 'field' or 'content' fields – Mauro Feb 25 '14 at 15:03
  • the AbstractPersonalTranslation have this 'field' and 'content' fields – Mauro Feb 25 '14 at 15:04
  • what version of A2LiX do you use? – denys281 Feb 25 '14 at 15:11
  • @denys281 "a2lix/translation-form-bundle": "2.*@dev" – Mauro Feb 25 '14 at 15:25
  • @nifr I'm following DoctrineExtension and the A2lix docs... – Mauro Feb 25 '14 at 15:32
  • edited my answer - please try the `a2lix_translations_gedmo` field-type and/or providing the `translatable_class` in the options array and report back. – Nicolai Fröhlich Feb 25 '14 at 15:37
  • @Mauro From documentation `"a2lix/translation-form-bundle": "1.*@dev" if you need to use the old Gedmo strategy` – denys281 Feb 25 '14 at 15:39
  • Unfortunately, I'm using https://github.com/stof/StofDoctrineExtensionsBundle and that is actually using the old Gedmo strategy. – Mauro Feb 25 '14 at 16:03

1 Answers1

2

The 2.0 version of the TranslationFormBundle isn't compatible with the current gedmo/doctrine-extensions version.

See the bundle's upgrade notes.

You'll need to use the currently unstable branches wip-v2.4.0 and .


solution:

Either update gedmo/doctrine-extensions ...

composer require gedmo/doctrine-extensions:wip-v2.4.0@dev
composer update gedmo/doctrine-extensions

... or downgrade your a2lix/translation-form-bundle version:

composer require a2lix/translation-form-bundle:~1.2
composer update a2lix/translation-form-bundle

important notice for the 1.x version of a2lix/TranslationFormBundle:

You need to use the a2lix_translations_gedmo field-type as described in the documentation.

Further you need to specify the translatable class in the options-array like this:

$builder->add('translations', 'a2lix_translations_gedmo', array( 
    'translatable_class' => "Your\Entity" 
); 
Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130