Skip to content

Commit 06aed96

Browse files
committed
feature #4354 [WCM] Added depreciation note for the cascade_validation constraint (peterrehm)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #4354). Discussion ---------- [WCM] Added depreciation note for the cascade_validation constraint | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8 | Fixed tickets | - This PR was based on symfony/symfony#12237 and has been updated based as symfony/symfony#15019. #4348 Commits ------- 22a87b5 Added depreciation note for the cascade_validation constraint and updated position of depreciation notes
2 parents 59569c0 + 22a87b5 commit 06aed96

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

reference/forms/types/form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on all types for which ``form`` is the parent type.
1111
| Options | - `action`_ |
1212
| | - `allow_extra_fields`_ |
1313
| | - `by_reference`_ |
14-
| | - `cascade_validation`_ |
14+
| | - `cascade_validation`_ (deprecated as of 2.8) |
1515
| | - `compound`_ |
1616
| | - `constraints`_ |
1717
| | - `data`_ |
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
cascade_validation
22
~~~~~~~~~~~~~~~~~~
33

4+
.. caution::
5+
6+
The ``cascade_validation`` option has been deprecated in Symfony 2.8 and will be removed
7+
in 3.0. Instead, use the ``Valid`` constraint in your model to cascade validation. Be aware
8+
of the fact that the ``validation_group`` option will not be considered for child forms.
9+
410
**type**: ``boolean`` **default**: ``false``
511

612
Set this option to ``true`` to force validation on embedded form types.
@@ -10,11 +16,10 @@ the data from ``CategoryType`` to also be validated.
1016

1117
.. tip::
1218

13-
Instead of using this option, it is recommended that you use the ``Valid``
19+
Instead of using this option, it is recommended that you use the :doc:`Valid </reference/constraints/Valid>`
1420
constraint in your model to force validation on a child object stored
1521
on a property. This cascades only the validation but not the use of
16-
the ``validation_groups`` option on child forms. You can read more
17-
about this in the section about
18-
:ref:`Embedding a Single Object <forms-embedding-single-object>`.
22+
the :ref:`validation_groups <book-forms-validation-groups>` option on child forms. You can read more
23+
about this in the section about :ref:`Embedding a Single Object <forms-embedding-single-object>`.
1924

2025
.. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc

0 commit comments

Comments
 (0)