Magento Forum

Warning: Invalid argument supplied for foreach() in /mnt/hgfs/Merc/Magento/app/code/core/Mage/Core/Controller/Varien/Front.php on line 118
 
tolick
Jr. Member
 
Total Posts:  5
Joined:  2009-02-09
 

Any idea why I’m getting this? It happens on Front.php:

const XML_STORE_ROUTERS_PATH 'web/routers';

       
Mage::dispatchEvent('controller_front_init_before', array('front'=>$this));

        
$routersInfo Mage::app()->getStore()->getConfig(self::XML_STORE_ROUTERS_PATH);

        
Varien_Profiler::start('mage::app::init_front_controller::collect_routers');
        foreach (
$routersInfo as $routerCode => $routerInfo{

I can’t find this web/routers file/directory anywhere. Not sure where its supposed to be or what’s supposed to be in it.

Thanks,
tom

Error stack:

WarningInvalid argument supplied for foreach()  in /mnt/hgfs/Merc/Magento/app/code/core/Mage/Core/Controller/Varien/Front.php on line 118
Trace
:
#0 /mnt/hgfs/Merc/Magento/app/code/core/Mage/Core/Controller/Varien/Front.php(118): mageCoreErrorHandler(2, 'Invalid argumen...', '/mnt/hgfs/Merc/...', 118, Array)
#1 /mnt/hgfs/Merc/Magento/app/code/core/Mage/Core/Model/App.php(517): Mage_Core_Controller_Varien_Front->init()
#2 /mnt/hgfs/Merc/Magento/app/code/core/Mage/Core/Model/App.php(860): Mage_Core_Model_App->_initFrontController()
#3 /mnt/hgfs/Merc/Magento/app/Mage.php(457): Mage_Core_Model_App->getFrontController()
#4 /mnt/hgfs/Merc/Magento/index.php(52): Mage::run()
#5 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
christ
Jr. Member
 
Total Posts:  5
Joined:  2008-04-04
 

I’m also encountering this problem while running Magento 1.2.1.1 on apache2/php5/mysql 5.0.51

WarningInvalid argument supplied for foreach()  in /home/xxxxxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php on line 118
Trace
:
#0 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(118): mageCoreErrorHandler(2, 'Invalid argumen...', '/home/xxxxxxxx/p...', 118, Array)
#1 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/App.php(517): Mage_Core_Controller_Varien_Front->init()
#2 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/App.php(860): Mage_Core_Model_App->_initFrontController()
#3 /home/xxxxxxx/public_html/app/Mage.php(457): Mage_Core_Model_App->getFrontController()
#4 /home/xxxxxxx/public_html/index.php(52): Mage::run()
#5 {main}

Any help with this would be greatly appreciated. I am stumped at the moment.

 
Magento Community Magento Community
Magento Community
Magento Community
 
openlatee
Member
 
Total Posts:  31
Joined:  2008-11-04
 

Same problem here.

have you get a solution ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
openlatee
Member
 
Total Posts:  31
Joined:  2008-11-04
 

Thanks christ !

Well, I’m not 100% sure. I no longer have the error. But I’m now struggling with another error.

What I did was clear the contents of my var directory. Where sessions and data is cached.

Now i’m running into php timeouts when magento tries to rebuild the contents.

I’m in the process of rebuilding and re-importing my database and will let you know if I experience the problem again or not.

Take care.
Chris.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tolick
Jr. Member
 
Total Posts:  5
Joined:  2009-02-09
 

I reinstalled and it went away… Not sure what was going on :(

-tom

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top