0

I get the error exception 'Mage_Core_Exception' with message 'Invalid block type: ' so no block is mentioned. Home is not loaded properly however. So kind of hard to debug this way. Complete trace is

2017-02-04T12:50:35+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/user/prelaunch.domain.com/app/Mage.php:595
Stack trace:
#0 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'content')
#3 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'content')
#4 /home/user/prelaunch.domain.com/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))
#5 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#6 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#7 /home/user/prelaunch.domain.com/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#8 /home/user/prelaunch.domain.com/app/code/local/Magestore/Megamenu/controllers/Adminhtml/MegamenuController.php(472): Mage_Adminhtml_Controller_Action->loadLayout()
#9 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Magestore_Megamenu_Adminhtml_MegamenuController->cacheAction()
#10 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('cache')
#11 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /home/user/prelaunch.domain.com/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#13 /home/user/prelaunch.domain.com/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#14 /home/user/prelaunch.domain.com/index.php(88): Mage::run('', 'store')
#15 {main}

Regular error log only reports an error from earlier on:

[Sat Feb 04 05:00:26 2017] [error] [client xx.xxx.xxx.xxx] File does not exist: /home/user/prelaunch.domain.com/js/lr_callprice/jquery.min.map

Any ideas how I can debug this properly?

9

1 Answer 1

5

As in the answer by alan storm, the issue is related to a block where you have not added a type for a block. e.g.

<block name="checkout.cart">

Where in your case, it seems something like this,

<block name="content">

When you find above code, Update it with

<reference name="content">

and complete <reference> tag instead of <block> tag.

I have a search script which can be useful for finding this error in your code,
Once you add search.php file in your magento root folder, run it like yordomain.com/search.php search for <block name="content"> keyword in xml files.
You will find the file which needs to be updated.

9
  • Did a grep -rnw 'app/' -e "<block name=" and found 16 instances of <block name=. See gist.github.com/jasperf/3c3e1fa75eadbb869b2e29f221e28354 . So should I replace all by reference name? Perhaps just the <block name="content"> in app/design/adminhtml/default/default/layout/megamenu.xml:127: , no?
    – rhand
    Commented Feb 4, 2017 at 15:49
  • Yes, @rhand, you are right, there is only one block which does not have a type attribute. Update that file, the error should be gone.
    – Neha Raval
    Commented Feb 4, 2017 at 15:53
  • Well, did that. Now megamenu cache is no longer working and the homepage is still blank though. Not even getting decent errors but File does not exist: /home/user/prelaunch.domain.com/js/lr_callprice/jquery.min.map
    – rhand
    Commented Feb 4, 2017 at 16:14
  • can you share your app/design/adminhtml/default/default/layout/megamenu.xml file?
    – Neha Raval
    Commented Feb 4, 2017 at 16:17
  • 1
    update in your file app/design/adminhtml/default/default/layout/megamenu.xml, Please replace <block type="content"><block type="megamenu/adminhtml_cache" name="megamenu.cache" template="megamenu/cache.phtml" /> </block> with <reference name="content"><block type="megamenu/adminhtml_cache" name="megamenu.cache" template="megamenu/cache.phtml" /> </reference>
    – Neha Raval
    Commented Feb 4, 2017 at 16:38

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.