2011-12-01 47 views
3

我真的很希望這裏有人能夠幫助解決這個問題。Magento:被遺忘的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('*/*/'); 
    } 
} 

的代碼塊我真的需要儘快解決這個問題。任何幫助深表感謝!

+0

顯然有異常的地方開火的答案,我們需要知道它是什麼幫助你。檢查它在var/log/exception.log文件中的內容。確保magento錯誤記錄處於打開狀態。 – georgiecasey

+0

開發者/日誌設置已啓用,但我沒有var/log/exception.log任何地方。我讀過Magento論壇,你可以檢查var/report /文件夾中的異常調試痕跡。該目錄中有2個文件。這有幫助嗎? – Andrea

+0

這是http://stackoverflow.com/questions/8331574/magento-blank-page-customer-forgotten-password-email-link的副本。請只發布您的問題一次。這個問題應該被刪除。 –

回答

7

貌似不支持我的主題爲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> 

工程就像一個魅力!

+0

這適用於我的1.7.0.2,但您必須確保清除所有緩存以使此更改生效! – stitz