簡體   English   中英

Magento:Forgotten Pword返回空白瀏覽器頁面

[英]Magento: Forgotten Pword returns Blank Browser Page

我真的希望有人可以幫忙解決這個問題。

我正在使用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

轉至:app / design / frontend / default / [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>

奇跡般有效!

檢查您的customer.xml。

請參閱此鏈接上的答案http://buyolx.blogspot.in/2015/03/magento-forgot-password-and-reset.html


暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM