1
votes

Whenever I am turning on the Developer mode in Magento 1.7 I am getting this warning message If there is any other warning or error this there it will show that error But when there is no error this screen is coming. Once I turn off the developer mode i can use web site.

Warning: get_class() expects parameter 1 to be object, boolean given in >C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php on line 1340

0 [internal function]: 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\htdocs\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->run(Array) #9 C:\xampp\htdocs\magento\index.php(87): Mage::run('', 'store') #10 {main}

Any help or guidance would we appreciated.

1

1 Answers

1
votes

You have a defunct observer; see 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;
}

From the rest of the stack trace it's possible to see that the event being observed is controller_front_init_routers (ref. Mage_Core_Controller_Varien_Front::init() (link)). Unless something has gone awry with Mage_Cms_Controller_Router (link), the issue must be with a custom module which is configured to observe this event.

To find the offending configuration, search in app/code for <controller_front_init_routers>.

You could also create a test script which does not invoke the Front Controller and use it to debug:

<?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')
);

Stock output would be as follows; anything else is your troublemaker:

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