Missing Javascript functionality for TextEditorField and CollectionField on nested forms

Open
#6,127 9 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

@lacatoire is already working on this.

Since May 4, 2026.

  • #7595 by @lacatoire — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Domain
frontend

Research direction

Start with the configureFields methods in ContratosTemplatesCrudController.php and ContratosCrudController.php, focusing on the nested AssociationField and its renderAsEmbeddedForm configuration. Reproduce the add/edit form with the embedded TextEditorField and CollectionField, then trace the existing JavaScript behavior for nested forms. Done means both fields render and behave as they do in a direct Contratos form.

Written by the indexing model from the issue text.

Description

priority: important

PHP 8.3.1
Symfony 6.4.3
EasyAdmin 4.8.12

I have 3 Crud Controllers
ContratosTemplates
Contratos
ContratosCampos

ContratosTemplates has an AssociationField that contains a Contratos
Contratos has a TextEditorField and a CollectionField of ContratosCampos

When I add/edit a ContratosTemplates the TextEditorField from Contratos is not rendered and the CollectionField renders poorly

Screenshot 2024-02-01 at 6 56 56 p m

However if I add/edit a Contrato the TextEditorField displays fine and the CollectionField renders fine (collapsible header, remove button and propper field spacing)

Screenshot 2024-02-01 at 6 56 07 p m

I expected ContratosTemplates add/edit to work the same way and so far I haven't been able to find a way to activate this functionality

Here are the ConfigureFields for each CrudController

ContratosTemplatesCrudController.php

public function configureFields(string $pageName): iterable
    {
        return [
            IdField::new('id')->hideOnForm(),
            BooleanField::new('principal'),
            AssociationField::new('idContratos', 'Contrato')
                ->renderAsEmbeddedForm(
                    ContratosCrudController::class,
                    'create_contratos_inside_a_contratosTemplates',
                    'edit_contratos_inside_a_contratosTemplates'
                )
        ];
    }

ContratosCrudController.php

public function configureFields(string $pageName): iterable
    {
        return [
            IdField::new('id')->hideOnForm(),
            BooleanField::new('active'),
            TextEditorField::new('contrato'),
            CollectionField::new('contratosCampos')
                ->renderExpanded()
                ->setEntryIsComplex()
                ->useEntryCrudForm(ContratosCamposCrudController::class),
        ];
}

ContratosCamposController.php

public function configureFields(string $pageName): iterable
    {
        return [
            IdField::new('id')->hideOnForm(),
            TextField::new('label', 'Nombre de Campo'),
            TextField::new('placeholder', 'Texto de Ayuda'),
        ];
    }
Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
2d 9h
Merged PRs (30d)
52

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EasyCorp/EasyAdminBundle

All issues in EasyCorp/EasyAdminBundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.