Merge remote branch 'CodeMeme/default-validator-improved-synchronized-error'

* CodeMeme/default-validator-improved-synchronized-error:
  FormError when not synchronized tells you the form name for easier debugging
This commit is contained in:
Fabien Potencier 2011-06-08 08:58:04 +02:00
commit 6881f01fd6

View File

@ -20,7 +20,7 @@ class DefaultValidator implements FormValidatorInterface
public function validate(FormInterface $form)
{
if (!$form->isSynchronized()) {
$form->addError(new FormError('The value is invalid'));
$form->addError(new FormError(sprintf('The value for "%s" is invalid', $form->getName())));
}
if (count($form->getExtraData()) > 0) {