How to diagnose "Invalid block type .." error?
Based on the stack trace you posted, it looks like this is happening when Magento is loading the layout update xml files, and using them to create the blocks which will render the HTML for the page.
These lines appear to be the problem
#1 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'checkout.cart')
#3 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'checkout.cart')
The addBlock
, createBlock
, and _getBlockInstance
methods all expect the first parameter to be a class alias string for the block. Something like checkout/cart
. However, in your system, this string is missing.
->addBlock('', 'checkout.cart')
Because Magento's so extendable, there's myriad reasons this might happen. The most common reason is somehow your catalog.xml
file has been changed such that this
<block type="checkout/cart" name="checkout.cart">
Is missing it's type
attribute. That might look like this
<block name="checkout.cart">
Or it could be a typo
<block typeX="checkout/cart" name="checkout.cart">
Hope that helps. If the problem ends up being something else be sure to come back and post the correct answer.
With help from the comments from my original post, I was able to track down the offending code!
Here's the snippet that was causing the exception:
<checkout_cart_index>
<reference name="content">
<block name="checkout.cart">
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.bottom" as="snippet_cart_bottom">
<action method="setBlockId"><block_id>snippet_cart_bottom</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.coupon.below" as="snippet_cart_coupon_below">
<action method="setBlockId"><block_id>snippet_cart_coupon_below</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.empty.bottom" as="snippet_cart_empty_bottom">
<action method="setBlockId"><block_id>snippet_cart_empty_bottom</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.list.below" as="snippet_cart_list_below">
<action method="setBlockId"><block_id>snippet_cart_list_below</block_id></action>
</block>
</block>
</reference>
</checkout_cart_index>
Revised code no longer causing exceptions:
<checkout_cart_index>
<reference name="checkout.cart">
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.bottom" as="snippet_cart_bottom">
<action method="setBlockId"><block_id>snippet_cart_bottom</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.coupon.below" as="snippet_cart_coupon_below">
<action method="setBlockId"><block_id>snippet_cart_coupon_below</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.empty.bottom" as="snippet_cart_empty_bottom">
<action method="setBlockId"><block_id>snippet_cart_empty_bottom</block_id></action>
</block>
<!-- Add CMS Static Block -->
<block type="cms/block" name="snippet.cart.list.below" as="snippet_cart_list_below">
<action method="setBlockId"><block_id>snippet_cart_list_below</block_id></action>
</block>
</reference>
</checkout_cart_index>