Skip to content

Propagate embedded controllers' field assets to parent form page#7595

Open
lacatoire wants to merge 1 commit intoEasyCorp:5.xfrom
lacatoire:fix-nested-form-assets-propagation-6127
Open

Propagate embedded controllers' field assets to parent form page#7595
lacatoire wants to merge 1 commit intoEasyCorp:5.xfrom
lacatoire:fix-nested-form-assets-propagation-6127

Conversation

@lacatoire
Copy link
Copy Markdown
Contributor

When a form embeds another CRUD controller via AssociationField::renderAsEmbeddedForm() or CollectionField::useEntryCrudForm(), the embedded controller's fields (TextEditorField, FileField, a nested CollectionField, etc.) carry their own CSS/JS assets. They live on the embedded EntityDto, never on the parent field, so AbstractCrudController::getFieldAssets() (which only walks top-level fields) never sees them: the parent form page renders without the editor JS, the collection JS, etc., and the nested widgets break visually and functionally.

Merge each embedded field's assets back into the parent FieldDto's own assets right after the embedded EntityDto is processed in both CollectionConfigurator::configureEntryType() and AssociationConfigurator::configureCrudForm(). Multi-level nesting cascades naturally because each level merges before its own parent does.

Closes #6127

When a parent form embeds another CRUD controller via AssociationField::renderAsEmbeddedForm()
or CollectionField::useEntryCrudForm(), the embedded controller's fields
(TextEditorField, FileField, nested CollectionField, etc.) carry their own CSS/JS
assets. Those live on the embedded EntityDto, never on the parent field, so
AbstractCrudController::getFieldAssets() (which only walks top-level fields)
never sees them: the parent form page renders without the editor JS, the
collection JS, etc., and the nested widgets break visually and functionally.

Merge each embedded field's assets back into the parent FieldDto's own assets
right after the embedded EntityDto's fields are processed. The parent's assets
filter (loadedOn) keeps the per-page semantics.

Closes EasyCorp#6127
@lacatoire lacatoire force-pushed the fix-nested-form-assets-propagation-6127 branch from a919be8 to e66e5b9 Compare May 4, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Javascript functionality for TextEditorField and CollectionField on nested forms

1 participant