8000 [Form] Made validation of form children configurable by webmozart · Pull Request #3128 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Made validation of form children configurable #3128

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

Merged
merged 1 commit into from
Jan 16, 2012

Conversation

webmozart
Copy link
Contributor

Bug fix: yes
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #797
Todo: adapt documentation

Travis Build Status

Child forms now aren't validated anymore by default. This is not a problem as long as @Valid constraints are properly put in your model. If you want to enable cascading validation, for example when there is no connection between the parent and the child model, you can set the option "cascade_validation" in the parent form to true.

This change is not backwards compatible, but from my estimation the break should not affect many applications.

…"cascade_validation" to `true` if you need it.
@kriswallsmith
Copy link
Contributor

👍

fabpot added a commit that referenced this pull request Jan 16, 2012
Commits
-------

0c70a41 [Form] Made validation of form children configurable. Set the option "cascade_validation" to `true` if you need it.

Discussion
----------

[Form] Made validation of form children configurable

Bug fix: yes
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #797
Todo: adapt documentation

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=optional-form-child-validation)

Child forms now aren't validated anymore by default. This is not a problem as long as @Valid constraints are properly put in your model. If you want to enable cascading validation, for example when there is no connection between the parent and the child model, you can set the option "cascade_validation" in the parent form to true.

This change is not backwards compatible, but from my estimation the break should not affect many applications.

---------------------------------------------------------------------------

by kriswallsmith at 2012-01-16T19:59:25Z

:+1:
@fabpot fabpot merged commit 0c70a41 into symfony:master Jan 16, 2012
@fabpot
Copy link
Member
fabpot commented Jan 16, 2012

merged, thanks. Don't forget to update the CHANGELOG and the UPGRADE file as well. I've done the former here: 172300e

@webmozart
Copy link
Contributor Author

Thanks for the reminder @fabpot. I adapted the UPGRADED file in #3129.

@craue
Copy link
Contributor
craue commented Jan 30, 2012

Using cascade_validation doesn't work as expected when validation groups are involved, while @Valid does.

@webmozart
Copy link
Contributor Author

@craue Could you open a ticket with more details please?

@craue
Copy link
Contributor
craue commented Jan 30, 2012

@bschussek: See #3219.

@guillaumesmo
Copy link
Contributor

Hi, one problem I have found is that using @Valid doesn't work when using validation_groups in the child form options. Is this considered a problem or is putting validation groups in child forms simply not done ?

@mvrhov
Copy link
mvrhov commented Nov 28, 2013

@guillaumesmo: You are right this doesn't work and there should be ticket opened about that, however I'm unable to find it.

@guillaumesmo
Copy link
Contributor

keep me informed if you do it, otherwise i'll post a ticket in a few hours

@guillaumesmo
Copy link
Contributor

OK, issue posted here: #9650

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

Successfully merging this pull request may close these issues.

7 participants
0