bc8ee6f497
This PR was merged into the 2.3 branch.
Discussion
----------
[Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6645
| License | MIT
| Doc PR | -
Consider the following entity:
```php
class Author
{
/**
* @Assert\NotBlank
*/
private $name;
private $age;
}
```
Right now, the "required" HTML attribute is set for both fields (since the default value of the "required" option is true). IMO this is wrong.
With this fix, the ValidatorTypeGuesser guesses `false` for the "required" option unless a NotNull/NotBlank constraint is present.
Commits
-------
|
||
---|---|---|
.. | ||
Extension | ||
Fixtures | ||
Guess | ||
Util | ||
AbstractDivLayoutTest.php | ||
AbstractExtensionTest.php | ||
AbstractFormTest.php | ||
AbstractLayoutTest.php | ||
AbstractRequestHandlerTest.php | ||
AbstractTableLayoutTest.php | ||
ButtonTest.php | ||
CallbackTransformerTest.php | ||
CompoundFormPerformanceTest.php | ||
CompoundFormTest.php | ||
FormBuilderTest.php | ||
FormConfigTest.php | ||
FormFactoryBuilderTest.php | ||
FormFactoryTest.php | ||
FormIntegrationTestCase.php | ||
FormPerformanceTestCase.php | ||
FormRegistryTest.php | ||
FormRendererTest.php | ||
NativeRequestHandlerTest.php | ||
ResolvedFormTypeTest.php | ||
SimpleFormTest.php |