Skip to content

[6.x] Fix filling old input values not being filled when they don't belong to a form - #16028

Open
andjsch wants to merge 1 commit into
statamic:6.xfrom
andjsch:fix-16027
Open

andjsch wants to merge 1 commit into
statamic:6.xfrom
andjsch:fix-16027

Conversation

@andjsch

@andjsch andjsch commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

{{ old }} is null inside the {{ fields }} loop of {{ form:create }} since 6.43.2 while the top-level {{ old }} still works.

Root cause — PR #16013

"Only fill old input into the form that was submitted" gated the per-field old variable behind ! $field->form() || $errors->any(), using this form's error bag having errors as a proxy for "this form was submitted". But Laravel flashes old input on any withInput() redirect — failed logins (user.* bags), custom controllers, addon flows — without a form.{handle} bag. In those cases the loop's old was suppressed while \View\Cascade.php kept exposing the full array at page level.

Fix — new src/Forms/OldInput.php with OldInput::shouldFill($errorBag).

Since a form.{handle} error bag is only ever flashed by that form's own failed submission, it's a reliable attribution signal: old input is filled unless it belongs to a different form's failed submission. This restores old input from all non-form sources while keeping #16013's cross-form isolation.

fixes #16027

@andjsch andjsch changed the title Fix #16027 [6.x] Fix filling old input values not being filled when they don't belong to a form Nov 24, 2026

This branch has not been deployed

No deployments
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.

Old input values get lost within fields-loop

1 participant