Fix rendering of closed field groups once openend #20185
Merged
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.
Scope
What's changed:
In #19962 we didn't take into account that with closed field groups, once opened the
pushGroupOptionsDown
only receives a subset of fields (the nested ones), which means the referenced groups are missing in the set. This resulted into an infinite loop in the function.To correctly handle such cases, we're now building a proper tree from the fields, which means the function does nothing if groups aren't part of the received array.
Corresponding test cases have been added.
Potential Risks / Drawbacks
N/A
Review Notes / Questions
Did a quick benchmark to ensure the new implementation is at least as fast as the previous one. In fact, it is slightly faster compared to a "patched version" of the previous implementation.
Fixes #20145