symfony/symfony — Issue #2945: Duplicated error when using a DataTransformer and a NotBlank constraint
Author: stof
Created: 2011-12-22 16:16:44+00:00
State: open
Labels: Form, Validator

If a DataTransformer fails, the value is set to ``null`` in the underlying object. This is logical as we don't have any value to set in it reliably (think for instance of the case where your DataTransformer transforms an id into an object and the setter uses a typehint). But this leads to an issue if the validation has a NotBlank or NotNull constraint on the field as you will then see an error ``This value should not be blank`` on the field (which was not blank in the client data).

See #2413 for a place where this error occurs often: the repeated type.