Hi, I really hope someone here can help out with this.
Magento 1.6.1.0 new install
If a customer clicks the forgotten password link on the frontend, they are sent an email with a link to click. When they click the link in the email, a blank white page is shown in the browser (no prompt to reset pword). The path when the email link is launched looks like this:
www.mystore.com/customer/account/resetpassword/?id=4 token=26f8abcc1efd5559ce81ced2706586db
The “error_log” said:
[30-Nov-2011 07:42:50] PHP Fatal error: Call to a member function setCustomerId() on a non-object in /home3/bestcara/public_html/app/code/core/Mage/Customer/controllers/AccountContr*oller.php on line 587
I really need to fix this as soon as possible. Any help is much appreciated!
Code block from AccountController.php
* 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) <------------------------------------Line 587
->setResetPasswordLinkToken($resetPasswordLinkToken);
$this->renderLayout();
} catch (Exception $exception) {
$this->_getSession()->addError(Mage::helper('customer')->__('Your password reset link has expired.'));
$this->_redirect('*/*/');
}
}
Looks like my theme was not supported for Magento 1.6.1.0
go to: app/design/frontend/default/[your_custom_theme_folder]/layout/customer.xml
add these codes:
<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 like a charm!