Magento – Magento 1.7 error invalid block type

magento-1.7

I have a strange problem in Magento 1.7.0.2. When I try to open the items in the catalog I get the following error in my logging. I have been tinkering around with the catalog.xml but even after reverting the changes with a backup it still won't work correctly.

It seems to be that the exception has to do with the Relatedslider from the theme. However this has worked correctly before. I have no clue where to look at the moment. Can someone point me in the right direction? Thanks!

2013-10-09T09:29:15+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Ongeldig bloktype:     Magentothem_Relatedslider_Block_Page_Html_Head' in     /home/public_html/domain.nl/app/Mage.php:594
Stack trace:
#0 /home/public_html/domain.nl/includes/src/__default.php(27333):     Mage::throwException('Ongeldig blokty...')
#1 /home/public_html/domain.nl/includes/src/__default.php(27275):      Mage_Core_Model_Layout->_getBlockInstance('relatedslider/p...', Array)
#2 /home/public_html/domain.nl/includes/src/__default.php(27310):      Mage_Core_Model_Layout->createBlock('relatedslider/p...', 'magentothem_rel...')
#3 /home/public_html/domain.nl/includes/src/__default.php(27077):     Mage_Core_Model_Layout->addBlock('relatedslider/p...', 'magentothem_rel...')
#4 /home/public_html/domain.nl/includes/src/__default.php(27043):     Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element),     Object(Mage_Core_Model_Layout_Element))
#5 /home/public_html/domain.nl/includes/src/__default.php(27048):     Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/public_html/domain.nl/includes/src/__default.php(13507):     Mage_Core_Model_Layout->generateBlocks()
#7 /home/public_html/domain.nl/includes/src/__default.php(10889):     Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/public_html/domain.nl/includes/src/__default.php(10828): Mage_Cms_Helper_Page-    >_renderPage(Object(Mage_Cms_IndexController), 'no-route')
#9 /home/public_html/domain.nl/app/code/core/Mage/Cms/controllers/IndexController.php(75):     Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
#10 /home/public_html/domain.nl/includes/src/__default.php(13582):     Mage_Cms_IndexController->noRouteAction()
#11 /home/public_html/domain.nl/includes/src/__default.php(17927):     Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#12 /home/public_html/domain.nl/includes/src/__default.php(17484):     Mage_Core_Controller_Varien_Router_Standard-    >match(Object(Mage_Core_Controller_Request_Http))
#13 /home/public_html/domain.nl/includes/src/__default.php(20061):     Mage_Core_Controller_Varien_Front->dispatch()
#14 /home/public_html/domain.nl/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /home/public_html/domain.nl/index.php(87): Mage::run('', 'store')
#16 {main} 

Edit>>
After disabling the compiler, as suggested below it still does not work. But I have enabled error displaying in the browser. From this the following error is now present:

Trace:
#0 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(387): Mage::exception('Mage_Eav', 'Source model "m...')
#1 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(201): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
#2 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(70): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array)
#3 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#4 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#5 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml()
#6 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#7 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#8 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs')
#9 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'product_tabs')
#10 /home/gitaar1b/public_html/domain.nl/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))
#11 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#12 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#13 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#14 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#15 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(250): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#16 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Catalog_ProductController->editAction()
#17 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#18 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/gitaar1b/public_html/domain.nl/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/gitaar1b/public_html/domain.nl/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#21 /home/gitaar1b/public_html/domain.nl/index.php(87): Mage::run('', 'store') 
#22 {main}

I still am not sure how to fix this, as I cannot find anything relevant on the subject.

Best Answer

If you take a look at your error call stack

#0 /home/public_html/domain.nl/includes/src/__default.php(27333):     Mage::throwException('Ongeldig blokty...')
#1 /home/public_html/domain.nl/includes/src/__default.php(27275):      Mage_Core_Model_Layout->_getBlockInstance('relatedslider/p...', Array)
#2 /home/public_html/domain.nl/includes/src/__default.php(27310):      Mage_Core_Model_Layout->createBlock('relatedslider/p...', 'magentothem_rel...')
#3 /home/public_html/domain.nl/includes/src/__default.php(27077):   

most of the files involved come from the includes/src/__default.php file. Magento only uses this file when it's running in "compiler" mode. Compiler mode is when Magento looks at all the module class files in app/code/*/*, and then makes a copy of those files in includes/src — it also combines many base classes in a single file, __default.php. This is done to increase performance in production systems.

So, step one would be to disable compiler mode, see if the error has gone away, and then re-compile your classes to catch whatever class was missed in the initial compilation. You can do this at

System -> Tools -> Compilation

Or via the shell script

$ php shell/compiler.php

If the problem does not go away when compilation mode is disabled, it looks like Magento is trying to instante a block (perhaps embedded in a CMS page) that doesn't exist.

Mage_Core_Model_Layout->createBlock('relatedslider/p...', 'magentothem_rel...')

Unfortunately, this block's full class alias (relatedslider/p...) is omitted. Figuring out the full block alias, and why Magento can't instantiate it (missing class, mistyped alias, etc.) will lead you to a solution for your problem.

Related Topic