Skip to content

Commit

Permalink
feature #4354 [WCM] Added depreciation note for the cascade_validatio…
Browse files Browse the repository at this point in the history
…n 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
  • Loading branch information
weaverryan committed Jun 19, 2015
2 parents 59569c0 + 22a87b5 commit 06aed96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on all types for which ``form`` is the parent type.
| Options | - `action`_ |
| | - `allow_extra_fields`_ |
| | - `by_reference`_ |
| | - `cascade_validation`_ |
| | - `cascade_validation`_ (deprecated as of 2.8) |
| | - `compound`_ |
| | - `constraints`_ |
| | - `data`_ |
Expand Down
13 changes: 9 additions & 4 deletions reference/forms/types/options/cascade_validation.rst.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cascade_validation
~~~~~~~~~~~~~~~~~~

.. caution::

The ``cascade_validation`` option has been deprecated in Symfony 2.8 and will be removed
in 3.0. Instead, use the ``Valid`` constraint in your model to cascade validation. Be aware
of the fact that the ``validation_group`` option will not be considered for child forms.

**type**: ``boolean`` **default**: ``false``

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

.. tip::

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

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

0 comments on commit 06aed96

Please sign in to comment.