FOSUserBundle icon indicating copy to clipboard operation
FOSUserBundle copied to clipboard

how to overwrite email validation?

Open gondo opened this issue 10 years ago • 3 comments

as of Symfony 2.5 Email constraint now has strict option. how to enable this for email field in FOSUser ? i've tried to overwrite https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/config/validation.xml file but the Email constraint is now duplicated rather than overwritten

gondo avatar Dec 17 '14 16:12 gondo

have you extends the fosuserBundle?

massil31 avatar Dec 18 '14 07:12 massil31

yes, overwritten is done properly. i know that "official" answer is to create custom validation group and change validation there, i am still not OK with this because it means duplicating every existing validation and than changing one option...

but apparently there is global configuration framework.validation.strict_email what should switch strict validation for every email validator

gondo avatar Dec 18 '14 10:12 gondo

First of all, thanks for great bundle! But I have a question about validation groups. I want to use validation groups as described in manual, but closure that I'm creating don't give any effect. So, as I understood there is no opportunity to set validation groups in setDefaultOptions method? With config.yml all works correct.

fender-hm avatar Jan 27 '15 10:01 fender-hm