Closed
Description
Preconditions
- Magento 2.2.2 Magento Open Source
- Nginx
- Developer mode, html/css/js minify/merge/bunlding disabled.
Steps to reproduce
- Install Magento 2.2.2 CE
- Remove footer newsletter block for the customer_account_createpassword handle
<referenceContainer name="form.subscribe" remove="true"/>
- Create any customer account.
- Logout on frontend and go to login page and click "Forgot Your Password?"
- Fill created customer email and click "Reset password"
- Follow on the link "Set a New Password" in received email letter
- Try enter somekind of password to the New Pasword field
Expected result
- Strength meter starts working, showing a different password strength as I type
Actual result
- Strength meter doesn't work.
Error on the console.
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
Went to the vendor/magento/module-customer/view/frontend/web/js/password-strength-indicator.js:77
if (password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
Apearently this.options.cache.email is undefined. Checked code above where it is declared - line:34
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
Checked values above:
this.options.formSelector = 'form'
this.options.emailSelector = 'input[type="email"]'
So in conlusion: email is being searched in any form, Meaning if there are no form with email - strength meter fails. I believe this can be a leftover from older code versions, because othervise this would be a bit of a nonsense.
I haven't created a branch for a fix, but I think this one would be an easy one:
- Make form selecter to select a right form (the one that is used to reset password)
- Add a hidden field in the form with type email with value of a customer that is reseting this password.
Or just make do something else - its just a suggestion, if that compare is really needed.
I hope this will help someone and it will be fixed :)
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.1 release lineThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release