Repository navigation
fix(schema): keep nested array manager when it shares its parent name - #5658
Open
theluckystrike wants to merge 1 commit into
Open
theluckystrike wants to merge 1 commit into
theluckystrike wants to merge 1 commit into
Conversation
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.
Fixes #4129
When an array field holds a nested array with the same name, both register under the same
scopedArrayName. The nested one replaced the parent's entry inarrayManagers, sogetManagerOfon an outer item no longer knew itsareafield and rendering threw "has no field named area".The comment above that code says the stored name keeps its flat form. So I left it alone, and nothing needs a migration. When a second array registers under a name that's already there, its fields are added to the existing manager's schema, and on a name clash the first one wins. The merged schema is a copy, so the parent field's own
schemaisn't touched.Every reader I found looks fields up by name (area rendering,
{% field %}, the wysiwyg list, the area patch path), and none validates or sanitizes through it.test/arrays-nested-same-name.jsrenders an area on an outer item whose nested array shares its name, and checks that a stored item with the flat name still resolves its manager. Both fail on main. Both pass with the fix. The full mocha suite on sqlite gives the same results as main, apart from one test indocument-versions.jsthat fails on both runs but not always the same one.Michael