EmailValidator wrongly rejects a valid e-mail

This change in EMAIL_DOMAIN is not correct:

Class: modules/gui/src/com/haulmont/cuba/gui/components/validators/EmailValidator.java

The regular expression considers this e-mail invalid: admin@uberaba.mg.gov.br

But we can easily confirm that this is a valid domain: http://www.uberaba.mg.gov.br

The .mg is related to the root cause, since the e-mail is considered valid after removing it.

If this was confirmed, is there a way to override this behavior while waiting for the fix?

Thanks,

Alexandre

Hello @ampaiva2060

It seems that our validator doesn’t consider arbitrary amount of domains and sub-domains. I’ve created an issue on GitHub: link.

You can create your own implementation of EmailValidator and use it instead of default. Probably you will need to override default screen to replace a validator, for example on User editor screen.

Regards,
Daniil.

1 Like

Hello @tsarev,

Thanks for the confirmation. So, chances are that we will have a fix some day.

Regarding “override default screen”, is there a link explaining how to do that step by step (or a sample project)?

I can see a lot of answers that mention override. I guess this is something very simple. However, it is so simple that no one wasted time documenting this :grinning:.

Regards,

Alexandre

It can be done via CUBA Studio on Generic UI tab:

image

Studio will create required files and configure an app to use new screen instead of default.

Regards,
Daniil

1 Like