2

I'm trying to overwrite Mage_Adminhtml_Block_Widget_Form in my extension but i can't seem to get it to work.

my config looks like this

<global>
   <blocks>
      <adminhtml>
         <rewrite>
             <widget_form>Baldwin_TestModule_Block_Adminhtml_Widget_Form</widget_form>
        </rewrite>
      </adminhtml>
   </blocks>
</global>

And my overwrite class (in directory: Baldwin/TestModule/Block/Adminhtml/Widget/Form.php) looks like this

class Baldwin_TestModule_Block_Adminhtml_Widget_Form
extends Mage_Adminhtml_Block_Widget_Form
{
    /**
     * Set Fieldset to Form
     *
     * @param array $attributes attributes that are to be added
     * @param Varien_Data_Form_Element_Fieldset $fieldset
     * @param array $exclude attributes that should be skipped
     */
    protected function _setFieldset($attributes, $fieldset, $exclude=array())
    {
        die("test");
    }
}

Does anybody have any idea what i'm doing wrong ?

Koen
  • 51
  • 3

1 Answers1

0

What exactly do you expect? Usually Mage_Adminhtml_Block_Widget_Form gets extended by concrete widgets and you can't change the inheritance tree with a rewrite. Your rewrite only has an effect if the form widget would be instantiated directly somewhere, like:

Mage::getBlock('adminhtml/widget_form');

Unfortunately you will have to overwrite the class in code/local/Mage/Adminhtml/Block/Widget/Form.php or find another solution for your requirements that does not change core classes (preferred!)

Fabian Schmengler
  • 24,155
  • 9
  • 79
  • 111