Is it possible to add a translatable association in Sonata Admin, using DoctrineBehaviors Translatable feature?
I mean, something like that:
// InfoPageAdmin.php
->add('translations', 'a2lix_translations', [
'fields' => [
'title' => [
'field_type' => 'text'
],
'content' => [
'field_type' => 'ckeditor',
'config_name' => 'default'
],
'slideshow' => [
'field_type' => 'sonata_type_model_list'
]
]
])
Where 'slideshow' is translatable field, associated with other entity:
// InfoPageTranslation.php
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\PictureCollection", cascade={"persist"}, fetch="EAGER")
* @ORM\JoinColumn(name="slideshow_id", referencedColumnName="id")
*/
protected $slideshow;
I got the following error:
ContextErrorException: Catchable Fatal Error: Argument 1 passed to Sonata\AdminBundle\Form\DataTransformer\ModelToIdTransformer::__construct() must implement interface Sonata\AdminBundle\Model\ModelManagerInterface, null given, called in D:\XAMPP\htdocs\mega\app\cache\dev\classes.php on line 13492 and defined in D:\XAMPP\htdocs\mega\app\cache\dev\classes.php line 12628
I hope that my question is clear.
Thank you!