From 070489b57b203acd824e71587050bddd432b721f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 5 Sep 2014 12:19:26 +0200 Subject: [PATCH] caution on `null` values in Expression constraint 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. --- reference/constraints/Expression.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst index 5db3373b55e..68526372837 100644 --- a/reference/constraints/Expression.rst +++ b/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 `. + For more information about the expression and what variables are available to you, see the :ref:`expression ` option details below.