0

enter image description hereAfter the upgrade from 2.4.3 to 2.4.5, I see that new code has been added in the upgraded forgotpassword.html that is disabling the reset button. How can I enable it please

Edit: Extending forgotpassword.html in custom module and removing the disabling code for Reset Password button works. Looking for an optimal solution. Thanks

2 Answers 2

2

This is a new feature introduced in Magento 2.4.5, but looks like it does not works as expected.

Since Magento 2.4.5, to support Google Recaptcha in the forgot password page, Magento add disabled HTML attribute to the forgot password button in case you use Google reCaptcha (enabled) and already configured the Google API Key for the reCaptcha.
In theory, if the attribute disabled HTML attribute is added to the forgot password button, once the customer filled out all required information, the button should be show. But looks like it does not works as expected. If you entered your email and passed reCaptcha but the button still disabled, I think it is bug from Magento code base.

There are some solutions to resolve this issue at this time, you can choose one that fit your need:

  1. Apply a patch file to remove disabled HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml.

Here you replace:

<button type="submit" class="action submit primary" id="send2" <?php if ($forgotPasswordButtonViewModel->disabled()): ?> disabled="disabled" <?php endif; ?>><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>

with

<button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
  1. Disable recaptcha_disable_forgot_password_button plugin file to remove disabled HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml.
  2. Override vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml file in your theme or your module to remove disabled HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml.

Here you replace:

<button type="submit" class="action submit primary" id="send2" <?php if ($forgotPasswordButtonViewModel->disabled()): ?> disabled="disabled" <?php endif; ?>><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>

with

<button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
  1. Investigate the JS issue and fix it by yourself: investigate why after you filled out all required fields and pass reCaptcha, code does not fire in dataForm.on('invalid-form.validate' function which located in vendor/magento/module-customer/view/frontend/web/js/block-submit-on-send.js and fix the issue.

Related documents:

5
  • thank you for the detailed reply...I have already implemented No.3 as a temporary fix. I will update you after I investigate on other solutions. Thanks again.
    – Siri
    Commented Dec 26, 2022 at 10:54
  • @Siri That sound great!
    – Tu Van
    Commented Dec 26, 2022 at 10:56
  • Accepting the answer as disabling the plugin works and seems to be the better option as of now.
    – Siri
    Commented Dec 26, 2022 at 11:56
  • @TuVan I Am facing the same issue with the Login and Create account button in Magento Commerce Cloud 2.4.6-p3. Is there any patch for this issue? Commented Mar 20 at 14:35
  • @VigneshBala you can create a patch based on my instructions and the instructions I shared above.
    – Tu Van
    Commented Mar 21 at 8:36
0

Can you please try to extend the form\forgotpassword.phtml and add the following codes to add the reset button,

           <button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
{
    "*": {
        "Magento_Customer/js/block-submit-on-send": {
            "formId": "form-validate"
        }
    }
}
</script>
1
  • I have extended already as a temporary fix, am looking for optimal solution..thank you
    – Siri
    Commented Dec 26, 2022 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.