1
votes

i try to override magento enterprise catalogevent block, but its same faltal error leading:Fatal error: Call to a member function setData() on a non-object in ..\www\app\code\core\Mage\Adminhtml\Block\Widget\Form\Container.php on line 129 my new module config.xml:

 <global>
        <blocks>
            <ss_todaysevents>
                <class>Ssd_Todaysevents_Block</class>
            </ss_todaysevents>
            <enterprise_catalogevent>
                <rewrite>
                    <adminhtml_event_edit_form>
                        Ss_TodaysEvents_Block_Adminhtml_Event_Edit_Form
                    </adminhtml_event_edit_form>
                </rewrite>
            </enterprise_catalogevent>
        </blocks>        
    </global>

Ss_TodaysEvents_Block_Adminhtml_Event_Edit_Form class is in ..\www\app\code\local\Ss\TodaysEvents\Block\Adminhtml\Event\Edit\Form.php and has following code:

class Ss_TodaysEvents_Block_Adminhtml_Event_Edit_Form extends Enterprise_CatalogEvent_Block_Adminhtml_Event_Edit_Form
{
    protected function _prepareForm()
    {
        parent::_prepareForm();       
        if (Mage::getConfig()->getModuleConfig('Ss_Brands')->is('active')) {
            $fieldset = $this->getForm()->getElements()->searchById('general_fieldset');
            $fieldset->addField('brand_name', 'select',
                                array(
                                     'label' => Mage::helper('brands')->__('Brand'),
                                     'title' => Mage::helper('brands')->__('Brand'),
                                     'name' => 'brands_id',
                                     'values' => Mage::helper('brands')->getBrandsArrayList(),
                                )
            );

        }
        return $this;
    }


}

What worng there? Thanks

1
Can you add the relevant code block that the error message is mentioning?Zachary Schuessler
<class>Ssd_Todaysevents_Block</class> Just out of curiosity, why the extra d? and not just Ss_ ... ?B00MER

1 Answers

0
votes

If the sole purpose of your module is a rewrite, you needn't configure a class group (global/blocks/ss_todaysevents). You are directly mapping a class to another class group _ class name.

Magento does not strip whitespace in text nodes. In your adminhtml_event_edit_form node your classname should not have whitespace around it, i.e.:

<adminhtml_event_edit_form>Ss_TodaysEvents_Block_Adminhtml_Event_Edit_Form</adminhtml_event_edit_form>