-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Validation Constraints for Collections #2559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
May I suggest editing the collection constraint reference: https://github.com/symfony/symfony-docs/blob/master/reference/constraints/Collection.rst |
@Sgoettschkes: You think it is helpful?I thought also about referencing it there. @weaverryan What do you think? I think I could make this happen on Friday. |
Correct me if I'm wrong, but error_bubbling seems like an option for the collection form field, not the constraint. If tha's correct, I don't like to do this, otherwise: please do it. |
@wouterj: The option is for the form field. However, if you do not consider that setting, you will have the issues as described. A tip would be sufficient I would think. |
+1 for the tip, let's do it! :) |
When using validation constraints most things work out of the box and easy. However for Collections it is strange, that the enabled error_bubbling leads to a passing of the error to the root form.
The behaviour is documented for the collection entity, but I think it should be documented as well for the actual constraints. I would suggest a tip that informs if you want to bind the error to the actual field, you need to disable error_bubbling. This would have saved some time for me.
I would submit a PR for that, but need Feedback if this is wanted, and where it should be implemented. Since there is no general page about Validation for Collections, there is the only way to add this to every Collection Validation opportunity.
The text was updated successfully, but these errors were encountered: