Permalink
Browse files

feature #4202 [Reference][Constraints] caution on `null` values in Ex…

…pression constraint (xabbuh)

This PR was merged into the 2.4 branch.

Discussion
----------

[Reference][Constraints] caution on `null` values in Expression constraint

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.4, 2.5
| Fixed tickets | part of #4191

This adds a warning to the reference of the Expression constraint explaining that `null` values won't be validated in Symfony 2.4 and Symfony 2.5.

Commits
-------

070489b caution on `null` values in Expression constraint
  • Loading branch information...
weaverryan committed Sep 16, 2014
2 parents 4267086 + 070489b commit ea068c22ffff653f020ea488b3e3e54d96d32949
Showing with 7 additions and 0 deletions.
  1. +7 −0 reference/constraints/Expression.rst
@@ -217,6 +217,13 @@ more about the expression language syntax, see
// ...
}
.. caution::
In Symfony 2.4 and Symfony 2.5, if the property (e.g. ``isTechnicalPost``)
were ``null``, the expression would never be called and the value
would be seen as valid. To ensure that the value is not ``null``,
use the :doc:`NotNull constraint </reference/constraints/NotNull>`.
For more information about the expression and what variables are available
to you, see the :ref:`expression <reference-constraint-expression-option>`
option details below.

0 comments on commit ea068c2

Please sign in to comment.