Skip to content

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

Merged
jasonvarga merged 1 commit into
statamic:6.xfrom
mynetx:fix/ensured-field-first-section
Aug 3, 2026
Merged

[6.x] Ensure fields into the first section of a tab instead of the last#15091
jasonvarga merged 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>
@jasonvarga

Copy link
Copy Markdown
Member

This is a questionable change.

I'd expect a programmatically-added thing to be appended to the end of the things. I'll let this through for now but part of me feels there might be some backlash. We'll see what feedback we get - there's a chance this'll need to be reverted.

@jasonvarga
jasonvarga merged commit 835d5cd into statamic:6.x Aug 3, 2026
21 checks passed
@mynetx

mynetx commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @jasonvarga. I agree with you, but if not let's do some brainstorm how to see alternative solutions for #13644. 🤔

@mynetx
mynetx deleted the fix/ensured-field-first-section branch August 3, 2026 22:01
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

2 participants