Propagate embedded controllers' field assets to parent form page#7595
Open
lacatoire wants to merge 1 commit intoEasyCorp:5.xfrom
Open
Propagate embedded controllers' field assets to parent form page#7595lacatoire wants to merge 1 commit intoEasyCorp:5.xfrom
lacatoire wants to merge 1 commit intoEasyCorp:5.xfrom
Conversation
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
a919be8 to
e66e5b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a form embeds another CRUD controller via
AssociationField::renderAsEmbeddedForm()orCollectionField::useEntryCrudForm(), the embedded controller's fields (TextEditorField,FileField, a nestedCollectionField, etc.) carry their own CSS/JS assets. They live on the embeddedEntityDto, never on the parent field, soAbstractCrudController::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 embeddedEntityDtois processed in bothCollectionConfigurator::configureEntryType()andAssociationConfigurator::configureCrudForm(). Multi-level nesting cascades naturally because each level merges before its own parent does.Closes #6127