0

After having installed a theme in Magento and played around a little bit on my next restart I tried to reach the site and I'm getting this error

Notice: Undefined index: catalog.topnav  in /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php on line 460

  #0 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(460): mageCoreErrorHandler(8, 'Undefined index...', '/var/www/html/m...', 460, Array)

  #1 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('page/html_topme...', 'catalog.topnav')
 #2 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('page/html_topme...', 'catalog.topnav')
 #3 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#4 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#5 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
 #6 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
   #7 /var/www/html/magento1.9/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
 #8 /var/www/html/magento1.9/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#9 /var/www/html/magento1.9/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#10 /var/www/html/magento1.9/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
 #11 /var/www/html/magento1.9/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
 #12 /var/www/html/magento1.9/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 /var/www/html/magento1.9/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
 #14 /var/www/html/magento1.9/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#15 /var/www/html/magento1.9/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /var/www/html/magento1.9/index.php(83): Mage::run('', 'store')
#17 {main}

I assume it's the theme's fault because I came across the same post somewhere on the internet but I'm not sure on how to remove the theme. Any fix on this or do I have to remove the theme ?

Thank you..!!

1

2 Answers 2

1

the error tels that your theme can't find catalog.topnav block in layout,

<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>

Check this in your layout theme app/design/frontend/{package}/{theme}/layout/page.xml or try to add the code bellow in local.xml :

<block type="page/html_header" name="header" as="header">
    <block type="page/template_links" name="top.links" as="topLinks"/>
    <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
    <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
        <label>Navigation Bar</label>
        <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
    </block>
    <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
        <label>Page Header</label>
        <action method="setElementClass"><value>top-container</value></action>
    </block>
    <block type="page/html_welcome" name="welcome" as="welcome"/>
</block>

Check also app/design/frontend/{package}/{theme}/page/html/topmenu.phtml

If you don't want to use this new theme, you have to go to:Admin->system->configuration->design

Package: You put the package name of the theme that it worked before, not the new one.

Themes: You put the theme name of the theme that it worked before in : template, skin, layout, default.

With this config, Magento will not load the new theme files, but if you have overwritten the other files of the old theme with the new one, this is another problem.

Good luck.

4
  • hhmmm.... didn't work... are you sure local.xml Ihave to add it in ?
    – Stefanos
    Sep 17, 2017 at 14:29
  • look my update please
    – PЯINCƎ
    Sep 17, 2017 at 14:34
  • I'm not sure what happened... :-( but in app/design/frontend there in base, default and rwd. My theme is in app/design/frontend/default/theme_name. Are my files overwritten ?
    – Stefanos
    Sep 17, 2017 at 14:41
  • No, if your theme name is in app/design/frontend/default/theme name/... and not in app/design/frontend/default/default/...it's good
    – PЯINCƎ
    Sep 17, 2017 at 15:10
0

While the most obvious thing to do was to delete all the theme files, I figured out that there was a megamenu module that came with the theme. So in the Configuration->Advanced section I just disabled the module and the page loads properly without the mega menu of course. Seems like a lot of people had the same problem with the specific theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.