Skip to content
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

#12075 :- Customer Email with diacritics isn't allowed #31003

Conversation

konarshankar07
Copy link
Contributor

Description (*)

This PR will fix the issue with the email address validation for email address internationalization (EAI)

Fixed Issues (if relevant)

  1. Fixes Customer Email with diacritics isn't allowed #12075

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Nov 21, 2020

Hi @konarshankar07. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Nov 21, 2020
@konarshankar07
Copy link
Contributor Author

@magento run all tests


class EmailAddress extends \Zend_Validate_EmailAddress implements \Magento\Framework\Validator\ValidatorInterface
class EmailAddress extends LaminasEmailValidator
Copy link
Contributor

@rogyar rogyar Nov 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @konarshankar07. Thank you for your work. Could you explain your fix, please? I see that you have removed the part that disables TLD validation. But validation of the name in the email (before @) still in place.

Also, you've removed the interface mention from the validator. Could you shed some light on the reason, please?

Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @rogyar
I think we should remove the zendframework1 dependency from the magento and use the Laminas dependency to the magento core that's why I removed the interface and TLD validation and extended the laminas Email validator.Let me know your thoughts
Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @konarshankar07. That makes sense, thank you for the explanation.

In the current version, we have the TLD validation set to false. However, in Laminas hostname validator, the useTldCheck set to true by default. So it means that after your change the TLD will be validated (but should not).

Also, still not obvious how this change will fix validation of the THIS@mail.com part of the email address that may contain diacritics.

Could you clarify the mentioned points, please?

Thanks.

@engcom-Charlie
Copy link
Contributor

Hi @konarshankar07. Could you please look at #31003 (comment)?
Thank you.

@engcom-Charlie
Copy link
Contributor

Hi @konarshankar07, do you have any updates?

@m2-community-project m2-community-project bot moved this from Changes Requested to Review in Progress in High Priority Pull Requests Dashboard Dec 1, 2020
@engcom-Charlie engcom-Charlie moved this from Review in Progress to Changes Requested in High Priority Pull Requests Dashboard Dec 1, 2020
@m2-community-project m2-community-project bot moved this from Changes Requested to Review in Progress in High Priority Pull Requests Dashboard Dec 3, 2020
@sidolov sidolov moved this from Review in Progress to Changes Requested in High Priority Pull Requests Dashboard Dec 16, 2020
@engcom-Charlie
Copy link
Contributor

Hi @konarshankar07. Could you please take a look at #31003 (comment)?
Thank you.

@engcom-Charlie
Copy link
Contributor

@konarshankar07 @rogyar with changes from this PR we have the next error during install:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Validator\DataObject::addRule() must implement interface Zend_Validate_Interface, instance of Magento\Framework\Validator\EmailAddress given
At first, needs to change \Magento\Framework\Validator\DataObject::addRule parameter type which will affect other validators. You can fix it but this change could be delivered only to 2.5 version since \Magento\Framework\Validator\DataObject marked as api.

@engcom-Charlie
Copy link
Contributor

@konarshankar07 please fix the issue mentioned above, I created a separate issue for removing a dependency here #31511.
Thank you.

@konarshankar07
Copy link
Contributor Author

Hello @engcom-Charlie
Thanks for the update and I will fix this issue using the zendframework1

@konarshankar07
Copy link
Contributor Author

@magento run all tests

1 similar comment
@konarshankar07
Copy link
Contributor Author

@magento run all tests

@konarshankar07 konarshankar07 marked this pull request as draft January 5, 2021 08:07
@konarshankar07
Copy link
Contributor Author

@magento run all tests

@engcom-Charlie engcom-Charlie removed their assignment Jan 5, 2021
@m2-community-project m2-community-project bot moved this from Changes Requested to Review in Progress in High Priority Pull Requests Dashboard Jan 5, 2021
Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @konarshankar07, can you update this PR with the latest mainline also have a look at the failed tests?

Thanks!

@engcom-Foxtrot
Copy link
Contributor

Hello, @konarshankar07. Unfortunately, we are closing this PR due to inactivity. If you want to continue your work on this issue, please one new one. Also, please do not replace the Zend_Validate with Laminas as such change poses a high risk.

@m2-assistant
Copy link

m2-assistant bot commented Mar 18, 2021

Hi @konarshankar07, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Validator Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customer Email with diacritics isn't allowed
6 participants