Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Fatal Error on Reset Password Page After Upgrade to Magento CE 1.7
 
scott5
Jr. Member
 
Total Posts:  3
Joined:  2011-03-15
 

After upgrading to Magento CE 1.7, I get the following error message after clicking on link included in the email that is sent after a “Lost Password” request is made.

Fatal error: Call to a member function setCustomerId() on a non-object in /home/web/mage161/app/code/core/Mage/Customer/controllers/AccountController.php on line 601

The code that it fails on is ->setCustomerId($customerId) included in the module below:

/**
     * Display reset forgotten password form
     *
     * User is redirected on this action when he clicks on the corresponding link in password reset confirmation email
     *
     */
    public function resetPasswordAction()
    
{
        $resetPasswordLinkToken 
= (string) $this->getRequest()->getQuery('token');
        
$customerId = (int) $this->getRequest()->getQuery('id');
        try 
{
            $this
->_validateResetPasswordLinkToken($customerId$resetPasswordLinkToken);
            
$this->loadLayout();
            
// Pass received parameters to the reset forgotten password form
            
$this->getLayout()->getBlock('resetPassword')
                ->
setCustomerId($customerId)
                ->
setResetPasswordLinkToken($resetPasswordLinkToken);
            
$this->renderLayout();
        
catch (Exception $exception{
            $this
->_getSession()->addError(Mage::helper('customer')->__('Your password reset link has expired.'));
            
$this->_redirect('*/*/forgotpassword');
        
}
    }

Any help would be much appreciated.  We have hired two consultants to help us with this and they have been of no help whatsoever.

Thank you in advance for any insight!

 
Magento Community Magento Community
Magento Community
Magento Community
 
RoseLeefind
Jr. Member
 
Total Posts:  3
Joined:  2012-06-21
Oklahoma
 

well, I think you can directly go to your database to change the password.

 
Magento Community Magento Community
Magento Community
Magento Community
 
scott5
Jr. Member
 
Total Posts:  3
Joined:  2011-03-15
 

Oklahoma, thanks so much for your response.  Unfortunately, this is a problem for our users and giving them access to our database to change their own passwords is not an option.

We are not having a problem with admin access.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lifepro
Jr. Member
 
Total Posts:  4
Joined:  2009-01-27
 

Hi I bumped into this error as well!

PHP Fatal errorCall to a member function setCustomerId() on a non-object in app/code/core/Mage/Customer/controllers/AccountController.php on line 587

Cause
The error is caused by incompatible customer.xml layout file in the theme layout directory.

Solution
To solve the issue it is enough to delete the custom customer.xml used by your theme in app/design/frontend/<your_theme_package>/<your_theme_name>/layout/, so default layout shipped with base theme (in app/design/frontend/base/default/layout/customer.xml) will be used.

For more information, see solution from http://www.zone-connect.co.uk/?p=42

I will try this also when I get back from work later! (can’t access in office)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Darren Grant
Sr. Member
 
Total Posts:  84
Joined:  2008-03-31
 

Thanks lifepro I found this post while searching for a solution to this problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
allreiko
Jr. Member
 
Total Posts:  3
Joined:  2011-06-02
 

GENIUS. THIS SOLVED MY ISSUE

 
Magento Community Magento Community
Magento Community
Magento Community
 
HectorPN
Member
 
Total Posts:  74
Joined:  2010-03-21
Adelaide, Australia
 

By using the BASE XML some pieces of my layout fall out of place so I tried replacing this block (from a 1.4.2 theme)

<customer_account_forgotpassword>
        <
remove name="left"/>

        <
reference name="root">
            <
action method="setTemplate"><template>page/1column.phtml</template></action>
            <
action method="setHeaderTitle" translate="title" module="customer"><title>Password forgotten</title></action>
        </
reference>
        <
reference name="content">
            <!--<
block type="core/template" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>-->
            <
block type="customer/account_forgotpassword" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>
        </
reference>
    </
customer_account_forgotpassword>

with this, from BASE 1.7.0.2

<customer_account_forgotpassword translate="label">
        <
label>Customer Forgot Password Form</label>
        <
remove name="right"/>
        <
remove name="left"/>

        <
reference name="head">
            <
action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
        </
reference>
        <
reference name="root">
            <
action method="setTemplate"><template>page/1column.phtml</template></action>
            <
action method="setHeaderTitle" translate="title" module="customer"><title>Password forgotten</title></action>
        </
reference>
        <
reference name="content">
            <!--<
block type="core/template" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>-->
            <
block type="customer/account_forgotpassword" name="forgotPassword" template="customer/form/forgotpassword.phtml" />
        </
reference>
    </
customer_account_forgotpassword>

but it didn’t work so I had to revert back to the brute force of removing it altogether. Any ideas on how to fix the specific bug would be appreciated.

(Although aside from vanity, the solution suggested above worked like a charm!)

 
Magento Community Magento Community
Magento Community
Magento Community
 
mishef
Jr. Member
 
Total Posts:  7
Joined:  2013-01-06
 

Add this code in bottom right before </layout> in your theme file customer.xml

<customer_account_resetpassword translate="label">
    <
label>Reset a Password</label>
    <
remove name="right"/>
    <
remove name="left"/>

    <
reference name="head">
        <
action method="setTitle" translate="title" module="customer">
            <
title>Reset a Password</title>
        </
action>
    </
reference>
    <
reference name="root">
        <
action method="setTemplate">
            <
template>page/1column.phtml</template>
        </
action>
        <
action method="setHeaderTitle" translate="title" module="customer">
            <
title>Reset a Password</title>
        </
action>
    </
reference>
    <
reference name="content">
        <
block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>
    </
reference>
</
customer_account_resetpassword>

Works for me on Magento 1.7.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
aemerich86
Jr. Member
 
Total Posts:  1
Joined:  2013-07-13
 

Hello,
We are trying to do this at Magento 1.7.0.2 and it didn’t work.

We’ve tried all the steps and no sucess.

Have anyone that it happens too?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SPARTdAN
Jr. Member
 
Total Posts:  1
Joined:  2012-04-14
 

I too have attempted these fixes posted but have the same error when using the reset password link.

Is there anything else I can try?

 
Magento Community Magento Community
Magento Community
Magento Community
 
smiya
Jr. Member
 
Total Posts:  9
Joined:  2013-08-07
 
mishef - 30 May 2013 01:42 AM

Add this code in bottom right before </layout> in your theme file customer.xml

<customer_account_resetpassword translate="label">
    <
label>Reset a Password</label>
    <
remove name="right"/>
    <
remove name="left"/>

    <
reference name="head">
        <
action method="setTitle" translate="title" module="customer">
            <
title>Reset a Password</title>
        </
action>
    </
reference>
    <
reference name="root">
        <
action method="setTemplate">
            <
template>page/1column.phtml</template>
        </
action>
        <
action method="setHeaderTitle" translate="title" module="customer">
            <
title>Reset a Password</title>
        </
action>
    </
reference>
    <
reference name="content">
        <
block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>
    </
reference>
</
customer_account_resetpassword>

Works for me on Magento 1.7.0.2

Hi,

I tried all the ways, with:
custom.XML
Accountcontroller.php
account_new.html

I tried anything, and nothing is working, the client receive the mail with link, but after clicking, always the BLANK PAGE.

Need you help & Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gooeygraphics
Jr. Member
 
Total Posts:  1
Joined:  2013-07-01
 

Does anyone have another solution for this?

I have tried the above, but my customer.xml (app/design/frontend/default/<theme name>/layout/customer.xml) already has the

<customer_account_resetpassword>
section.

I have tried deleting my customer.xml file and clearing cache and sessions and I still get this error:

Cannot save a new password.
Your password reset link has expired.

I also made sure i was signed out of admin account but nothing seems to fix this.

Anyone have another solution?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top