fix(form): Error messages displayed twice with form type "sonata_type_native_collection" or "sonata_type_immutable_array" when "error_bubbling" sets to false#8335
Merged
Conversation
…_native_collection" or "sonata_type_immutable_array" when "error_bubbling" sets to false fix sonata-project#2761 # Conflicts: # src/Resources/views/Form/form_admin_fields.html.twig
VincentLanglet
approved these changes
Sep 9, 2025
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.
Subject
fix error messages displayed twice with form type "sonata_type_native_collection" or "sonata_type_immutable_array" when "error_bubbling" sets to false.
I am targeting this branch, because it's a fix.
Closes #2761
(related to #8208)
Step To Reproduce
Countconstraints withmin=2Sonata\AdminBundle\Form\Type\CollectionTypeorSonata\Form\Type\ImmutableArrayTypefield targeting this new property.'error_bubbling' => falseform option on this fieldScreenshot
Changelog
The error is already displayed by
form_rowblock.I add some tests to ensure that the error message will be displayed, but I think it's not the best way as the FooAdmin form will not be able to be submit (it will always have validation errors)