EasyCorp / EasyCorp/EasyAdminBundle
Missing Javascript functionality for TextEditorField and CollectionField on nested forms
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 8d 2h
- Merged PRs (30d)
- 11
Description
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
However if I add/edit a Contrato the TextEditorField displays fine and the CollectionField renders fine (collapsible header, remove button and propper field spacing)
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'),
];
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- javascript, php, symfony
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100