Skip to content

[6.x] Ensure fields into the first section of a tab instead of the last - #15091

Open
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/ensured-field-first-section
Open

[6.x] Ensure fields into the first section of a tab instead of the last#15091
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/ensured-field-first-section

Conversation

@mynetx

@mynetx mynetx commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

When a blueprint tab has multiple sections, fields added at runtime via ensureField() get appended to the last section. The most visible casualty is the Super User toggle: add a new section to the user blueprint and the toggle jumps into it, away from the other user details.

Before the v4 tabs rewrite (#7746), ensured fields defaulted to the first section. This restores that behaviour: ensured fields that don't already exist in the blueprint now land at the end of the first section of the tab. Fields that already exist keep their position, and ensureFieldPrepended() still puts them at the top.

While in there, ensuring a field that lives inside an imported fieldset now writes the config override back to the section the import is actually in. Previously the override could end up as a duplicate import descriptor in a different section whenever the import wasn't in the fallback section.

BeforeAfter
statamic-13644-before statamic-13644-after

Fixes #13644

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Super toggle in user blueprint moves to latest section created in the blueprint

1 participant