2

I'm attempting to override the core navigation module in Magento with my plugin however, it is not working as it should. The plugin runs however an error is thrown.

2015-01-19T06:43:13+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Invalid block type: VNav_Catalog_Block_Navigation' in C:\wamp\www\magento\app\Mage.php:595
Stack trace:
#0 C:\wamp\www\magento\includes\src\__default.php(28016): Mage::throwException('Invalid block t...')
#1 C:\wamp\www\magento\includes\src\__default.php(27958): Mage_Core_Model_Layout->_getBlockInstance('catalog/navigat...', Array)
#2 C:\wamp\www\magento\includes\src\__default.php(27993): Mage_Core_Model_Layout->createBlock('catalog/navigat...', 'catalog.leftnav')
#3 C:\wamp\www\magento\includes\src\__default.php(27760): Mage_Core_Model_Layout->addBlock('catalog/navigat...', 'catalog.leftnav')
#4 C:\wamp\www\magento\includes\src\__default.php(27726): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 C:\wamp\www\magento\includes\src\__default.php(27731): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 C:\wamp\www\magento\includes\src\__default.php(13941): Mage_Core_Model_Layout->generateBlocks()
#7 C:\wamp\www\magento\app\code\core\Mage\Catalog\controllers\CategoryController.php(148): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 C:\wamp\www\magento\includes\src\__default.php(14015): Mage_Catalog_CategoryController->viewAction()
#9 C:\wamp\www\magento\includes\src\__default.php(18399): Mage_Core_Controller_Varien_Action->dispatch('view')
#10 C:\wamp\www\magento\includes\src\__default.php(17933): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 C:\wamp\www\magento\includes\src\__default.php(20705): Mage_Core_Controller_Varien_Front->dispatch()
#12 C:\wamp\www\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#13 C:\wamp\www\magento\index.php(85): Mage::run('', 'store')
#14 {main}

Plugins files:

C:\wamp\www\magento\app\code\local\VNav\Catalog\etc\config.xml

<?xml version="1.0"?>
<config>
<modules>
    <VNav_Catalog>
        <version>0.1.0</version>
    </VNav_Catalog>
</modules>

<global>
    <blocks>
        <catalog>
            <rewrite>
                <navigation>VNav_Catalog_Block_Navigation</navigation>
            </rewrite>
        </catalog>
    </blocks>
</global>
</config>

C:\wamp\www\magento\app\code\local\VNav\Catalog\Block\Navigation.php:

class VNav_Catalog_Block_Navigation extends Mage_Catalog_Block_Navigation{}

C:\wamp\www\magento\app\etc\modules\VNav_Catalog.xml:

<?xml version="1.0"?>
<config>
<modules>
    <VNav_Catalog>
        <active>true</active>
        <codePool>local</codePool>
        <depends />
    </VNav_Catalog>
</modules>
</config>

Any ideas why? Thanks!

1 Answer 1

1

Your rewrite code seems to be ok. From your screen shot I can see that magento compilation has been enabled within your system. Please disable compilation within admin>System>Tool>Compilation and after that enable compilation again.

3
  • Hi Amit, The errors have been removed however unfortunately my plugin is not replacing the existing core code, any idea why?
    – Oliver K
    Commented Jan 19, 2015 at 11:10
  • I also tried updating the core code, still no updates applied..
    – Oliver K
    Commented Jan 19, 2015 at 11:22
  • some where you have call like block type="VNav_Catalog_Block_Navigation" or createBlock('VNav_Catalog_Block_Navigation')
    – Amit Bera
    Commented Jan 19, 2015 at 11:22

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.