I have a Customer entity that only has a unique Email field to it. I am trying to edit a customer\'s email and the validation works fine. However I have this in my controller:>
For debug purposes you can use $form->getErrorsAsString()
instead of $form->getErrors()
if you use Symfony 2.*
Quoted from this answer:
$form->getErrorsAsString()
should only be used to debug the form...it will contain the errors of each child elements which is not the case of $form->getErrors().
UPDATE 1:
"With more recent Symfony versions, you must use $form->getErrors(true, false);
instead. First param corresponds to deep
and second to flatten
" (see the comment by @Roubi)