Skip to content

[WCM] Added depreciation note for the cascade_validation constraint #4354

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
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to both the Valid constraint and the validation_group (this is less important) option?


**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