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

Fix bug Magento 2.2.2 password reset strength meter #13429 #13761

Conversation

aoldoni
Copy link
Contributor

@aoldoni aoldoni commented Feb 21, 2018

Fix bug "Magento 2.2.2 password reset strength meter" #13429 by doing the email comparison only if an email field exists.

The form email input field selector at the "password-strength-indicator.js" is generic enough to match any input field "email" in the frontend at that time. This causes the password strength indicator to work in the password reset email screen in the default theme, given that this selector ends up matching the email field of the newsletter subscription form.

However, if you are using a theme in which the newsletter subscription email form is removed, it then causes this password strength validation to break. Moreover, it doesn't make much sense to compare your password with any possible email that is written in the newsletter subscription form.

This was done as part of the #MLAU18 contribution day.

Description

This PR simply causes the condition in which the password is compared to the email to be skipped in this situation, removing the Javascript error. Further review of this selector (that populates the this.options.cache.email variable) to narrow it so it only matches the email fields that are part of the same form as the password field should be done in the future.

Fixed Issues

  1. Magento 2.2.2 password reset strength meter #13429

Manual testing scenarios

  1. Test reset password screen with the "newsletter subscription" email field in there (default Magento). The password strength indicator already works correctly in this situation.
  2. Now remove such newsletter subscription field and test again. A js error will be thrown as per described in the issue. This PR fixes such js error and causes the password strength indicator to work again in this case.

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 on Travis CI are green)

…doing the email comparison only if an email field exists
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 21, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
MAGETWO-88145 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@aoldoni thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@aoldoni
Copy link
Contributor Author

aoldoni commented Feb 22, 2018

Hi @okorshenko / @ihor-sviziev , I wonder if it makes sense to merge this into 2.3 as well, at least so we don't have the javascript error there. On top of this, in 2.3, the more complete fix can then be developed.

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.

None yet

4 participants