Skip to content

[6.x] Fix form fields named "title" breaking the form's title in the CP - #16061

Merged
duncanmcclean merged 3 commits into
statamic:6.xfrom
jasonbaciulis:fix-form-title-clobbered-by-field
Nov 26, 2026
Merged

duncanmcclean merged 3 commits into
statamic:6.xfrom
jasonbaciulis:fix-form-title-clobbered-by-field

Conversation

@jasonbaciulis

@jasonbaciulis jasonbaciulis commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

If a form has a choice field (e.g. Dropdown, Multiple Choice, Yes/No, Checkboxes) with the handle title, the form's title breaks on the CP pages that receive the whole form object (Builder, Logic, Connect). Instead of "Contact Us", the page gets {value: "Contact Us", label: "Contact Us", key: "Contact Us"}.

image

This happens because those controllers passed the Form object straight to Inertia, which serializes it into its augmented array. Augmentation looks up each key's fieldtype in the form's blueprint, which holds its submission fields, so the form's title was run through the title field's fieldtype. The same thing happens with other keys, like a toggle named status.

This PR passes an explicit form prop with just the title, handle and status the pages actually use, like the submissions listing already does.

@jasonbaciulis
jasonbaciulis force-pushed the fix-form-title-clobbered-by-field branch from 3b13cae to 997b82d Compare November 26, 2026 06:37
@jasonbaciulis
jasonbaciulis marked this pull request as ready for review November 26, 2026 06:43
ampagent and others added 2 commits November 26, 2026 16:11
the augmented form ran its keys through the fieldtypes of submission fields with the same handle, so a `title` dropdown turned the page title into an object. pages only need the title, handle and status.

Amp-Thread-ID: https://ampcode.com/threads/T-457e559d-20ac-4fee-9bb4-ee1180d18bef
Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
Amp-Thread-ID: https://ampcode.com/threads/T-457e559d-20ac-4fee-9bb4-ee1180d18bef
Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
@duncanmcclean

Copy link
Copy Markdown
Member

Thanks!

@duncanmcclean
duncanmcclean merged commit e6c58c5 into statamic:6.x Nov 26, 2026
62 checks passed
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.

3 participants