fix: exclude supertype extend mixins from fieldset processing to prev…#2410
Open
pvollenweider wants to merge 1 commit into
Open
fix: exclude supertype extend mixins from fieldset processing to prev…#2410pvollenweider wants to merge 1 commit into
pvollenweider wants to merge 1 commit into
Conversation
…ent non-deterministic field assignment
🦜 ChachalogNo changelog entries detected. Learn more about Chachalog. Create a new entry online or run |
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.
Description
When two mixins both declare
extends = jnt:page(or any shared target type) and one is a supertype of the other,getExtendMixins()returns both. Because the underlying collection iterates over aHashMap, processing order is non-deterministic. Depending on which mixin is processed first,findAndRemoveField()during fieldset merge moves properties from the correct activated fieldset into an inactive one, causing fields to silently disappear from the Content Editor form.Fix: after collecting the extend mixin list, filter out any entry that is a supertype of another entry in the same list. The more specific mixin already carries all supertype properties via inheritance, so the supertype entry is redundant.
Discovered while investigating a customer case (ARKEMA-1813) where
akmmix:sampleCartPage > jmix:templateMixin, akmmix:sampleCartHeader— both havingextends = jnt:page— causedtitleanddescriptionfromakmmix:sampleCartHeaderto intermittently not appear in Content Editor after theaddMixinmechanism appliedakmmix:sampleCartPage.Checklist
Source code
Tests
Manual validation: define two mixins where one extends the other and both have
extends = jnt:page. Map the more specific mixin viaaddMixin. Create a page using that template and confirm all inherited properties appear in Content Editor consistently across multiple attempts.