2012-12-28 39 views
-1

RE:EE v1.10.1.1Magento的頁面凍結/帳戶建立後的空白

你好,

最近我發現,一個用戶提交表單創建一個帳戶後註冊過程頁凍結。它死於'/ customer/account/createpost /'。

似乎死在線路#325(/

$session->setCustomerAsLoggedIn($customer);
)/app/code/core/Mage/Customer/controllers/AccountController.php中的這一行上。

當將用戶設置爲登錄狀態時,它似乎在無效/空會話中窒息。只有在刷新凍結頁面之後,它纔會記錄/顯示錯誤。我還沒有發現任何其他錯誤/警告/所記錄的消息......在任何日誌(包括服務器日誌):


a:5:{i:0;s:62:"Mage registry key "_singleton/customer/session" already exists";i:1;s:1247:"#0 /server_path/html/app/Mage.php(192): Mage::throwException('Mage registry k...') 
#1 /server_path/html/app/Mage.php(446): Mage::register('_singleton/cust...', Object(Mage_Customer_Model_Session)) 
#2 /server_path/html/app/code/core/Mage/Customer/controllers/AccountController.php(50): Mage::getSingleton('customer/sessio...') 
#3 /server_path/html/app/code/core/Mage/Customer/controllers/AccountController.php(75): Mage_Customer_AccountController->_getSession() 
#4 /server_path/html/app/code/core/Mage/Core/Controller/Varien/Action.php(409): Mage_Customer_AccountController->preDispatch() 
#5 /server_path/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('create') 
#6 /server_path/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 
#7 /server_path/html/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch() 
#8 /server_path/html/app/Mage.php(627): Mage_Core_Model_App->run(Array) 
#9 /server_path/html/index.php(95): Mage::run('', 'store') 
#10 {main}";s:3:"url";s:25:"/customer/account/create/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:2:"sg";} 

下一行(#326)發送歡迎電子郵件。如果第325行被註釋掉,那麼電子郵件仍然被髮送,如果這樣做,則首次嘗試在#137行上的'/ customer/account/loginPost /'上登錄帳戶扼流器:

$session->login($login['username'], $login['password']);

一次刷新頁面會顯示儀表板。

無論哪種方式帳戶似乎正確創建和賬戶功能是事後正常,沒有其他登錄問題。

最近有一些變化,但他們都不應該與客戶和/或客戶/會話有任何關係...至少不是我所知道的。

偶然是否有人有一個想法在代碼中的任何常見潛在magento陷阱......我可以在另一個腳本/模塊間接做一些事情會導致類似這樣的事情?

我一直在這樣做比我應該更長,覺得我已經回到起點沒有任何領先/成功。我有點覺得我錯過了/忽略了一些明顯的東西。任何意見,想法,建議或想法都會受到讚賞。

謝謝。

尊敬, JamesD

[B]注:[/ B]我最後一次親自檢查這個功能是一兩個月前,它並沒有這樣做。自從我製作/添加了一些自定義模組後,他們又不應該直接連接到客戶和/或客戶會話。

另外,一年前我們確實爲'customer_login'和'customer_before_save'事件添加了一些附加信息,但過去沒有任何問題,所以我不認爲其中的任何一個會成爲原因..唯一的另一個變化是Magento從EE 1.9升級到1.10。

空會話例如....

這裏的會話的外觀,當頁面扼流圈,如:

Mage_Customer_Model_Session Object 
    (
     [_customer:protected] => 
     [_isCustomerIdChecked:protected] => 
     [_skipSessionIdFlag:protected] => 
     [_data:protected] => Array 
      (
       [_session_validator_data] => Array 
        (
         [remote_addr] => 155.77.22.255 
         [http_via] => 
         [http_x_forwarded_for] => 
         [http_user_agent] => Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11 
        ) 

       [session_hosts] => Array 
        (
         [www.slimgenics.com] => 1 
        ) 

       [id] => 
       [messages] => Mage_Core_Model_Message_Collection Object 
        (
         [_messages:protected] => Array 
          (
          ) 

         [_lastAddedMessage:protected] => Mage_Core_Model_Message_Success Object 
          (
           [_type:protected] => success 
           [_code:protected] => Thank you for registering. 
           [_class:protected] => 
           [_method:protected] => 
           [_identifier:protected] => 
           [_isSticky:protected] => 
          ) 

        ) 

       [before_auth_url] => https://www.domain.com/customer/account/index/ 
       [no_referer] => 1 
      ) 

     [_hasDataChanges:protected] => 1 
     [_origData:protected] => 
     [_idFieldName:protected] => 
     [_isDeleted:protected] =>
+0

如果您使用的是Magento Enterprise(基於EE v1.10.1.1),您應該要求Magento支持來研究這個問題。 – FlorinelChis

+0

magento支持不是它看起來的,相信我,它很難跟上它,特別是當你需要快速修復和調試時... – ADM

+0

你能夠登錄嗎? magento初始化一個單例兩次。這不應該發生;) –

回答

1

你的描述應該提高這裏(Magento的CE 1.7.0的錯誤。2作爲參考):

// app/Mage.php:472 
$registryKey = '_singleton/'.$modelClass; 
if (!self::registry($registryKey)) { 
    self::register($registryKey, self::getModel($modelClass, $arguments)); 
} 

因此,在密鑰存在之前立即進行檢查。我不認爲,EE代碼會做其他事情。所以你必須回答的問題是:爲什麼!self::registry($registryKey)false

我有更深的發掘。我認爲會話對象的創建失敗並返回false。這意味着關鍵的檢查是正確的,但在Mage::register() failse檢查,因爲它與isset()檢查:

// app/Mage.php:216 
public static function register($key, $value, $graceful = false) 
{ 
    if (isset(self::$_registry[$key])) { 
     if ($graceful) { 
      return; 
     } 
     self::throwException('Mage registry key "'.$key.'" already exists'); 
     // [...] 

的問題是:爲什麼失敗會話對象的創建。

0

問題已解決。

該問題源於我沒有意識到的文件更改。 這個改變顯然導致了一個循環(死亡的地方)拋出'Can not redeclare'消息。引起多次調用的文件中的'require'語句。

我發現這一點的唯一方法是從一個自定義的API。我用它來測試賬戶創建功能,幸運的是Soap處理程序能夠拋出錯誤並將其記錄在Magento error.log(它從未做過)中。那個'重新聲明'的錯誤信息在那裏,並且讓我看到了被改變的文件。

感謝大家的投入。