php – Magento:Forgotten Pword返回空白浏览器页面

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – Magento:Forgotten Pword返回空白浏览器页面脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我真的希望有人可以帮忙解决这个问题.

我正在使用Magento 1.6.1.0新安装

如果客户点击前端的忘记密码链接,他们会收到一封邮件,其中包含点击链接.当他们单击电子邮件中的链接时,浏览器中会显示一个空白页面(没有提示重置pword).启动电子邮件链接时的路径如下所示:

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

这是AccountController.PHP代码

* 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),<------------------------------------Line 587
            ->setResetPasswordLinkToken($resetPasswordLinkToken);
        $this->renderLayout();
    } catch (Exception $exception) {
        $this->_getSession()->addError(Mage::helPEr('customer')->__('Your password reset link has expired.'));
        $this->_redirect('*/*/');
    }
}

我真的需要尽快解决这个问题.任何帮助深表感谢!

解决方法

看起来我的主题不支持Magento 1.6.1.0

去:
应用程序/设计/前端/认/ [your_custom_theme_folder] /layout/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>

奇迹般有效!

@H_304_40@

脚本宝典总结

以上是脚本宝典为你收集整理的php – Magento:Forgotten Pword返回空白浏览器页面全部内容,希望文章能够帮你解决php – Magento:Forgotten Pword返回空白浏览器页面所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。