I have overridden a core file with my own file. This part is working correctly.
<adminhtml>
<rewrite>
<catalog_category_tabs>MyModule_Adminhtml_Block_Tabs</catalog_category_tabs>
</rewrite>
</adminhtml>
However when trying to add a custom tab with a block for content, I'm running into issues.
class MyModule_Adminhtml_Block_Tabs extends Mage_Adminhtml_Block_Catalog_Category_Tabs
protected function _prepareLayout()
{
// ...
// dispatch event add custom tabs
Mage::dispatchEvent('adminhtml_catalog_category_tabs', [
'tabs' => $this,
]);
// My tab
$this->addTab('custom', [
'label' => Mage::helper('catalog')->__('Custom Tab'),
'content' => $this->getLayout()->createBlock(
'adminhtml/tab_custom',
'category.custom.grid'
)->toHtml(),
]);
return parent::_prepareLayout();
}
The createBlock
method is returning false.
The referenced file is at MyModule/Adminhtml/Block/Tab/Custom.php
. Is there something I'm missing?