symfony/symfony — Issue #2896: validator->validate() does not return nested errors
Author: PorridgeBear
Created: 2011-12-15 23:02:07+00:00
State: open

Perhaps this is my misunderstanding, but the way in which I am trying to validate is using

'''php
$errorList = $this->get('validator')->validate($myObjectWithNestedValidatedObjectProperties);
'''

However, the errorList only contains root object constraint violations, even though nested property objects have contraint violations (I debugged out from GraphWalker and can confirm the violations work).

Indeed, if I just use the standard FormView way of outputting errors then the errors work fine.

My understanding is that validate should return a full and complete list of errors, traversing the children properties to obtain all contraint violations. This, in any event, would be very useful.

For now I will have to write my own walker to get a list of errors.

Thanks