-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Unmapped forms are not validated #11268
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
Fixed by #12237. |
fabpot
added a commit
that referenced
this issue
Jun 17, 2015
This PR was merged into the 2.8 branch. Discussion ---------- [Form] Deprecated "cascade_validation" | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #11268 (requires explicit work though) | License | MIT | Doc PR | TODO This is #12237 rebased on 2.8. The "cascade_validation" option was designed for a 1% use case and comparatively used way too often when the `Valid` constraint should have been used instead. Also, there seem to be bugs with that option (#5204). The option is now deprecated. When using the 2.5 Validator API, you can set the "constraints" option of the respective child to a `Valid` constraint instead. Alternatively, set the constraint in the model (as most people hopefully do). Commits ------- 6c554c6 [Form] Deprecated "cascade_validation"
@webmozart shouldn't unmapped forms run the walk data automatically, as they are separate root object graphs ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an issue being there since 2.1.
The FormValidator runs the validation of the underlying object graph in 2 cases:
cascade_validation
set totrue
This means that when you have a subform with
mapped
set tofalse
, the only way to have its object graph validation is to enablecascade_validation
on all parents of the unmapped field, which will lead to duplicate validation of the object graph of the parent if it uses@Assert\Valid()
properly.As unmapped forms define a new object graph, I think it would make sense to run the validation on them as well.
/cc @webmozart
The text was updated successfully, but these errors were encountered: