TextEditorField does not work with AssociationField

34 views Asked by At

I have a problem with the way TextEditorField works. I have a Block and Text table and I want to use easy-admin to be able to create blocks with Text and Image. The relationship with the text and image works fine, it's just that the TextEditorField isn't working.

TextCrudController

use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;

    public function configureFields(string $pageName): iterable
    {
        return [
            IdField::new('id')->hideOnForm(),
            AssociationField::new('lanqgue_id', 'Langue'),
            TextField::new('titre', 'Titre Du Text'),
            TextEditorField::new('contenu', 'Text'),
        ];
    }

BlockCrudController

use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;

    public function configureFields(string $pageName): iterable
    {
        return [
            IdField::new('id')->hideOnForm(),
            TextField::new('title', 'Nom du Block'),
            AssociationField::new('text_id', 'Text')
->renderAsEmbeddedForm(TextCrudController::class),
            AssociationField::new('image_id', 'Image')
->renderAsEmbeddedForm(ImageCrudController::class),
            BooleanField::new('actif', 'Actif Block'),
        ];
    }

Screen

I tried to display the TextCrudController form alone, but as soon as I link it with BlockCrudController, the TextEditorField doesn't work.

0

There are 0 answers