3

For some reason in our 2.3.0 installation the admin's reset password page does not show the form.

There is nothing appearing in the Magento error logs or reports. Also server logs are not showing anything.

I re-deployed static files by force (I'm in developer mode) and cleared the caches.

Everything else seems to work.

Any ideas what could cause this?

Reset password page form missing

5
  • I have the same issue, did you find the solution ?
    – Taschert
    Aug 14, 2019 at 8:03
  • Unfortunately I don't remember anymore what caused this, but I think I got it fixed. Check your translation files and it's encoding and special characters at least, if you use them. Maybe also manually delete some static file folders etc.
    – Webninja
    Aug 14, 2019 at 8:26
  • I found something, the block displaying the form have the name="content" in the layout. If I change the name the block is displayed. I will juste redeclare the block with an other name on this page
    – Taschert
    Aug 14, 2019 at 8:32
  • @Taschert you have find any solution for that? please update answer here i am same issue facing in magento 2.3.2 Jan 29, 2020 at 13:01
  • @RakeshDonga I have just posted the answer
    – Taschert
    Jan 29, 2020 at 14:16

1 Answer 1

2

I have created a Module and redeclared the layout for the forgotten password page

//File app/code/Vendor/Module/view/adminhtml/layout/adminhtml_auth_resetpassword.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="login.content">
            <block class="Magento\Backend\Block\Template" name="contentt" template="Vendor_Module::admin/resetforgottenpassword.phtml" />
        </referenceContainer>
    </body>
</page>

The new block just need to have a different name than "content".

//File app/code/Vendor/Module/view/adminhtml/templates/admin/resetforgottenpassword.phtml
<form method="post" data-mage-init='{"form": {}, "validation": {}}' action="<?= /* @escapeNotVerified */ $block->getUrl('*/auth/resetpasswordpost', ['_query' => ['id' => $block->getRequest()->getParam("id"), 'token' => $block->getRequest()->getParam("token")]]) ?>" id="reset-password-form" autocomplete="off">    <fieldset class="admin__fieldset">
        <legend class="admin__legend"><span><?= /* @escapeNotVerified */ __('Reset a Password') ?></span></legend><br />
        <input name="form_key" type="hidden" value="<?= /* @escapeNotVerified */ $block->getFormKey() ?>" />
        <div class="admin__field _required field-password">
            <label class="admin__field-label" for="password"><span><?= /* @escapeNotVerified */ __('New Password') ?></span></label>
            <div class="admin__field-control">
                <input type="password" class="admin__control-text" data-validate="{required:true, 'validate-admin-password':true}" name="password" id="password" placeholder="new password" autocomplete="off" />
            </div>
        </div>
        <div class="admin__field _required field-confirmation">
            <label class="admin__field-label" for="confirmation"><span><?= /* @escapeNotVerified */ __('Confirm New Password') ?></span></label>
            <div class="admin__field-control">
                <input type="password" class="admin__control-text" data-validate="{required:true, 'validate-cpassword':true}" name="confirmation" id="confirmation" placeholder="confirm new password" autocomplete="off" />
            </div>
        </div>
        <div class="form-actions">
            <div class="actions">
                <button type="submit" title="<?= /* @escapeNotVerified */ __('Reset Password') ?>" class="action-reset action-primary"><span><?= /* @escapeNotVerified */ __('Reset Password') ?></span></button>
            </div>
            <div class="links">
                <a class="action-back" href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml', ['_nosecret' => true]) ?>"><?= /* @escapeNotVerified */ __('Back to Sign in') ?></a>
            </div>
        </div>
    </fieldset>
</form>

In the original template file the funtions "getResetPasswordLinkToken" and "getUserId" does not exist in the block.

I hope this helps you

7
  • are you sure ? this file because i have implement your code my side but not working for me can you here post full code and here name = "contentt" here tt two time taken Jan 29, 2020 at 14:25
  • I'm sure, that's all. Did you enable the module, cleared the cache ?
    – Taschert
    Jan 29, 2020 at 14:29
  • I have this in a huge module, I can't add juste this part. Do you have an error in the log files ? I have also overloaded resetforgottenpassword.phtml
    – Taschert
    Jan 29, 2020 at 14:35
  • @RakeshDonga I have added more information
    – Taschert
    Jan 29, 2020 at 14:45
  • Thanks Man it's working :) Jan 29, 2020 at 16:43

Your Answer

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

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