Skip to content

[Validator] Add additional hint when egulias/email-validator needs to be installed #47189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Aug 4, 2022

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

When using the Symfony\Component\Validator\Constraints\Email constraint with 'mode' => 'strict', a helpful error message is shown when the necessary package is not installed.

However, when configuring strict mode as a framework setting (https://symfony.com/doc/current/reference/configuration/framework.html#email-validation-mode) and omitting the mode setting on the constraint itself, that message was missing.

@xabbuh
Copy link
Member

xabbuh commented Aug 4, 2022

What about also performing this check in the configuration itself?

@mpdude
Copy link
Contributor Author

mpdude commented Aug 5, 2022

That might throw the exception also when the strict setting is only set in configuration, but never actually used. We might do it that way, but it would behave different from setting strict as an option only... which is why I chose to do it that way here.

@xabbuh
Copy link
Member

xabbuh commented Aug 5, 2022

Yeah, you are right. Probably it's better play safe here and not do that as a bugfix.

@fabpot
Copy link
Member

fabpot commented Aug 5, 2022

Thank you @mpdude.

@fabpot fabpot merged commit c944281 into symfony:4.4 Aug 5, 2022
@mpdude mpdude deleted the patch-5 branch August 5, 2022 12:23
@fabpot fabpot mentioned this pull request Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants