Skip to content

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

Closed
peterrehm opened this issue Apr 25, 2013 · 5 comments
Closed

Validation Constraints for Collections #2559

peterrehm opened this issue Apr 25, 2013 · 5 comments

Comments

@peterrehm
Copy link
Contributor

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.

@Sgoettschkes
Copy link
Contributor

May I suggest editing the collection constraint reference: https://github.com/symfony/symfony-docs/blob/master/reference/constraints/Collection.rst

@peterrehm
Copy link
Contributor Author

@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.

@wouterj
Copy link
Member

wouterj commented Jun 5, 2013

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.

@peterrehm
Copy link
Contributor Author

@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.

@weaverryan
Copy link
Member

+1 for the tip, let's do it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants