symfony/symfony — Issue #2413: Repeated form type misbehaving when NotBlank is set
Author: ondrowan
Created: 2011-10-16 19:35:47+00:00
State: open

I have a password field set with NotBlank and MinLength constraints:

```php
/*
* @Assert\NotBlank()
* @Assert\MinLength(limit=8)
*/
protected $plainPassword;
```

And I want it to be repeated:

```php
$builder->add('plainPassword', 'repeated');
```

Now what happens:

* when I don't type anything to any of the fields, I get `NotBlank` error
* when I type in 2 same passwords shorter than 8 characters, I get `MinLength` error
* when I type in 2 different passwords shorter than 8 characters, I get `NotBlank` **and** `repeated` errors
* when I type in 2 different passwords with at least 8 characters, I get `NotBlank` **and** `repeated` errors

What is the reason for showing also `NotBlank` error message when the two fields don't match? Is this a bug or feature?