Magento Call to a member function setCustomerId() on a non-object in Mage/Customer/controllers/AccountController.php on line 587

Article ID #1220
Revision: 1.3
Last update: 2012-01-09


Password reset function in Magento errors with the following error message on a Forgot password link after upgrade to Magento

PHP Fatal error: Call to a member function setCustomerId() on a non-object in app/code/core/Mage/Customer/controllers/AccountContr​oller.php on line 587


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



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.


Or the custom customer.xml can be updated to include the following section:

<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>
    <reference name="root">
        <action method="setTemplate">
        <action method="setHeaderTitle" translate="title" module="customer">
            <title>Reset a Password</title>
    <reference name="content">
        <block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>

Please refer to app/design/frontend/base/default/layout/customer.xml for the sample.

Did this article help you solve your issue?

Average rating: 3.14 (50 votes)

completely useless 1 2 3 4 5 most valuable

Tags: , ,