2013-02-21 34 views
1

每當我打開Magento 1.7中的開發人員模式,我收到此警告消息 如果有任何其他警告或錯誤,它會顯示該錯誤 但是,當沒有錯誤這個屏幕即將到來。 一旦我關閉開發人員模式,我可以使用網站。如何解決Magento 1.7開發人員模式

警告:get_class()預計參數1爲對象,在布爾> C中給出:\ XAMPP \ htdocs中\ Magento的\應用\代碼\核心\法師\核心\模型\ App.php上線1340

0 [內部函數]:mageCoreErrorHandler(2,'get_class()exp ...','C:\ xampp \ htdocs ...',> 1340,Array)#1 C:\ xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Model \ App.php(1340):> get_class(false)#2 C:\ xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Model \ App。 php(1317):> Mage_Core_Model_App - > _ callObserverMethod(false,'check',Object(Varien_Event_Observer))#3> C:\ xampp \ htdocs \ magento \ app \ Mage.php(447):Mage_Core_Model_App-> dispatchEvent('controller_fron ...',Array)#4> C:\ xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Controller \ Varien \ Front.php(147) :?> Mage :: dispatchEvent('controller_fron ...',Array)#5> C:\ xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Model \ App.php(749):?> Mage_Core_Controller_Varien_Front-> init()#6> C:\ xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Model \ App.php(1094):Mage_Core_Model_App - > _ initFrontController()#7> C:\ xampp \ magento \ app \ code \ core \ Mage \ Core \ Model \ App.php(354):Mage_Core_Model_App-> getFrontController()#8 C:\ xampp \ htdocs \ magento \ app \ Mage.php(683) Mage_Core_Model_App->運行(陣列)#9 C:\ XAMPP \ htdocs中\的magento \的index.php(87):法師::運行( '', '存儲')#10 {主}

任何幫助或指導,我們讚賞。

回答

1

你有一個不存在的觀察者;見Mage_Core_Model_App::_callObserverMethod() (link)

protected function _callObserverMethod($object, $method, $observer) 
{ 
    if (method_exists($object, $method)) { 
     $object->$method($observer); 
    } elseif (Mage::getIsDeveloperMode()) { 
     Mage::throwException('Method "'.$method.'" is not defined in "'.get_class($object).'"'); 
    } 
    return $this; 
} 

從堆疊的其餘部分跟蹤有可能看到被觀察的事件是controller_front_init_routers(參考文獻Mage_Core_Controller_Varien_Front::init() (link))。除非出現Mage_Cms_Controller_Router (link)錯誤,否則問題必須是配置爲觀察此事件的自定義模塊。

要查找違規配置,請在應用程序/代碼中搜索<controller_front_init_routers>

你也可以create a test script which does not invoke the Front Controller,並用它來調試:

<?php 
ini_set('display_errors',true); 
error_reporting(E_ALL | E_STRICT); 
include 'app/Mage.php'; 
Mage::setIsDeveloperMode(true); 
Mage::app(); 

Zend_Debug::dump(
    Mage::getConfig()->getXpath('//controller_front_init_routers//class') 
); 

股票輸出將是如下:別的什麼是你的麻煩製造者:

array(1) { 
    [0] => object(Mage_Core_Model_Config_Element)#66 (1) { 
     [0] => string(26) "Mage_Cms_Controller_Router" 
    } 
} 
+0

感謝@benmarks與您的測試文件的幫助。我發現問題是我創建的新模塊沒有配置正確。 Thanks allot – abhiahirwar 2013-02-22 04:20:52

相關問題