Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error 500 if "framework.validation.email_validation_mode" is set to "html5-allow-no-tld" #60352

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

Closed
emmanuel-nz opened this issue May 5, 2025 · 0 comments

Comments

@emmanuel-nz
Copy link

emmanuel-nz commented May 5, 2025

Symfony version(s) affected

7.2.5

Description

According to the docs (https://symfony.com/doc/current/reference/configuration/framework.html#email-validation-mode), the default validation mode can be changed to one of the values supported by the email validator, which are (according to this page: https://symfony.com/doc/current/reference/constraints/Email.html#mode) html5, html5-allow-no-tld, strict.

But when I try to change the default value to html5-allow-no-tld, I get a 500 error with this message:

The value "html5-allow-no-tld" is not allowed for path "framework.validation.email_validation_mode". Permissible values: "html5", "loose", "strict"

I think there is probably a mismatch between the values expected by the validator and the ones allowed by the framework config.

How to reproduce

Change the framework.validation.email_validation_mode config to html5-allow-no-tld.

Possible Solution

I believe this line might be the problem:

->enumNode('email_validation_mode')->values(['html5', 'loose', 'strict'])->defaultValue('html5')->end()

Additional Context

Image

@emmanuel-nz emmanuel-nz added the Bug label May 5, 2025
fabpot added a commit that referenced this issue May 7, 2025
…ion modes can be configured (xabbuh)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] ensure that all supported e-mail validation modes can be configured

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #60352
| License       | MIT

this update was forgotten when adding the `html5-allow-no-tld` e-mail validation mode in #47872

Commits
-------

b8b3c37 ensure that all supported e-mail validation modes can be configured
@fabpot fabpot closed this as completed May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants