Magento Customer Reset Password Error after Upgrade
We recently upgraded a customers Magento website from 126.96.36.199 to 188.8.131.52. Everything seemed to go very well. However after the new website went live we noticed a small error when customers were requesting new passwords via the ‘forgot my password’ link on the login page. As far as errors when upgrading a Magento websites go this is a tiny blip and we were very happy to have such a small issue.
When we went to the reset password page we were presented with the following error:
PHP Fatal error: Call to a member function setCustomerId() on a non-object in [dir]/app/code/core/Mage/Customer/controllers/AccountController.php on line 601
The reason for this is quite simple. The error occurs because the layout XML is incorrect in the new Magento websites theme. When upgrading we had copied a version of customer.xml located in mytheme/layouts/across from the old version of Magento to the new one. This version did not contain the new layout handle that the new version of Magento require.
Adding the below into the customer.xml file within the new theme fixed the issue:
<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>