0

I've been going around in circles here trying to find reason why my block is not loading when i extend it. Can you help me to extend it Original file is

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php

my file

app/code/local/Comp/Module/Block/Adminhtml/Catalog/Product/Attribute/Edit/Tab/Options.php

comp_module/app/code/local/Comp/Module/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <Comp_Module>
            <version>0.1.0</version>
        </Comp_Module>
    </modules>
    <global>
        <blocks>
            <module>
                <class>Comp_Module_Block</class>
            </module>
            <adminhtml>
                <rewrite>
                    <catalog_product_attribute_edit_tab_options>Comp_Module_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Options</catalog_product_attribute_edit_tab_options>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

app/etc/modules/Comp_Module.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Comp_Module>
            <active>true</active>
            <codePool>local</codePool>
        </Comp_Module>
    </modules>
</config>
3
  • Please add more details about what error are you facing? also check your log files for errors. Commented Mar 27, 2017 at 12:24
  • i got this error: exception 'Mage_Core_Exception' with message 'Invalid block type: Comp_Module_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options' in /var/www/project/web/app/Mage.php:595 Stack trace: #0 /var/www/project/web/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...') #1 /var/www/project/web/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('adminhtml/catal...', Array) Commented Mar 27, 2017 at 12:37
  • Please add your solution as an answer and Mark it as correct so it may help others. Commented Apr 11, 2017 at 13:56

1 Answer 1

0

Update your app\code\local\Comp\Module\Block\Adminhtml\Catalog\Product\Attribute\Edit\Tab\Options.php file with below code.

<?php
class Comp_Module_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Options extends Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
{

}

Re-compile if you have compilation enabled.

Refresh your cache.

1
  • Hey Jaimin, i managed to fix the issue by following your advice of checking the error logs. thanks! Commented Mar 27, 2017 at 14:27

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.