This is a very common question, but this one is a little different.
I'm trying to overwrite/rewrite a Form block from another module. I'm already rewriting other blocks from this module without issues, I have Extension Conflict module that tells me my override is there, and it can properly display the object trace. I've done a dump of Mage::getConfig()->getNode()
with the block I'm overriding and it correctly lists only my override.
My cache is disabled, and I've cleared it multiples times. I've checked a lot of things, and this is either a very weird issue or a very dumb one (that I will punch myself for when I find it).
So, my config file :
<config>
<modules>
<Digitagri_Extendedmdn>
<version>1.0.0</version>
</Digitagri_Extendedmdn>
</modules>
<global>
<blocks>
<digitagri_extendedmdn>
<class>Digitagri_Extendedmdn_Block</class>
</digitagri_extendedmdn>
<AdvancedStock>
<rewrite>
<Warehouse_Edit_Form>Digitagri_Extendedmdn_Block_MDN_AdvancedStock_Warehouse_Edit_Form</Warehouse_Edit_Form>
</rewrite>
</AdvancedStock>
</blocks>
The original block that I'm rewriting :
<?php
class MDN_AdvancedStock_Block_Warehouse_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
}
The new block from my module :
class Digitagri_Extendedmdn_Block_MDN_AdvancedStock_Warehouse_Edit_Form extends MDN_AdvancedStock_Block_Warehouse_Edit_Form
{
protected function _prepareForm()
{
//$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
//$form->setUseContainer(true);
//$this->setForm($form);
Mage::log("Rewrite works!",null,"test.log",true);
//return Mage_Adminhtml_Block_Widget_Form::_prepareForm();
//return parent::_prepareForm();
}
}
And just in case, here's a screenshot of my folder structure :
And that's it. When I add a Mage::log
in the original block, it works, but when I do in the override, nothing shows up. Even if I comment the whole rewritten block, the page behaves as usual.
It seems to never be called at all, even though everything else (magento, modules..) says "I see this rewrite and it's fine".
I'm ready for the really silly mistake.