Repository navigation
Fix grouped errors not rendering on the update operation - #6083
Merged
tabacitu merged 1 commit intoSep 17, 2026
Merged
Conversation
Since Laravel-Backpack#5911 the hidden _form_id input and the grouped_errors partial both fall back to $id on the update operation. old('_form_id') is always a string, while $id is the entry key (an integer for most models), so the strict comparison in grouped_errors.blade.php fails and the grouped error alert never renders on edit forms. Compare both values as strings. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Since #5911 (fix for #5908) the hidden
_form_idinput andcrud::inc.grouped_errorsboth fall back to$idon the update operation:old('_form_id')is always a string, while$idon the update operation is the entry key (an integer for most models), so the strict comparison fails and the grouped error alert never renders on edit forms. Inline errors still work because the JS compares two strings.This is easy to miss for simple fields because the inline message under the field is enough, but for
repeatablefields (whereform_content.blade.phpdeliberately does not append inline messages inside arepeatable-group) the user gets red inputs and no message at all.Reproduce
On any CRUD with a required field and
groupedErrorsenabled (the default), open the update form, empty the field and save. On create the red alert with the messages shows at the top; on update it does not.Fix
Compare both ids as strings.
Tested on backpack/crud 7.0.42 and verified the same code is on
main.🤖 Generated with Claude Code