0
votes

I am trying to override a custom modules adminhtml block. The block is an adminhtml tabs/form block.

I get an error from the associated tabs.php block...in the beforeHtml() function, if i rewrite correctly.

Heres my code that I believe works fine for rewriting:

   <blocks>
        <devaf>
            <class>Dev_Affil_Block</class>
        </devaf>
        <affiliateplus>
            <rewrite>
                <adminhtml_account_edit_tab_form>
                    Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form
                </adminhtml_account_edit_tab_form>
            </rewrite>
        </affiliateplus>
    </blocks>

Actual error is:

    20  3.5764  29562296    Mage_Core_Block_Abstract->toHtml( ) ..\List.php:43
    21  3.5767  29562448 Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tabs->_beforeToHtml( )    ..\Abstract.php:862


  exception 'Mage_Core_Exception' with message 'Invalid block type: Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form

I believe the error is caused here...trying to init the block:

file: Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tabs

   $this->addTab('general_section', array(
        'label'     => Mage::helper('affiliateplus')->__('General Information'),
        'title'     => Mage::helper('affiliateplus')->__('General Information'),
        'content'   =>  $this->getLayout()->createBlock('affiliateplus/adminhtml_account_edit_tab_form')->toHtml(),
    ));

My custom form class, extends the class im trying to override/overwrite.

 class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tab_Form {

I have also tried extending the usual Mage class...this didnt work either.

 class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {

I have a debug stmt in this class, once I can get that stmt output, I should be fine.

Anyone any thoughts/tips?

thanks S

1
Which class does Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extend? Perhaps you could add that declaration to your question as well.clockworkgeek

1 Answers

0
votes
 <rewrite>
    <class_to_override>
        my_class
    </class_to_override>
 </rewrite>

Should be:

 <rewrite>
    <class_to_override>my_class</class_to_override>
 </rewrite>

And it should extend:

 Mage_Adminhtml_Block_Widget_Form