2011-12-26 8 views
1

私はmagento enterpriseのcatalogeventブロックをオーバーライドしようとしていますが、それと同じエラーが続きます。致命的なエラー: .. \ www \ app \ codeのオブジェクト以外のオブジェクトのsetData \コア\メイジ\ Adminhtml \ブロック\ウィジェット\フォーム\ Container.phpライン上の129 私の新しいモジュールのconfig.xml:magento admin form alter

<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のクラスが含まれている.. \のwww \アプリは\ code \ローカル\ Ssの\ TodeesEvents \ Block \ Adminhtml \ Event \ Edit \ Form.phpにあり、次のコードを持つ:

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; 
    } 


} 

何がありますか?ありがとう

+0

では、エラーメッセージが言及され、関連するコード・ブロックを追加することはできますか? –

+0

' Ssd_Todaysevents_Block'ちょうど好奇心から、なぜ余分な 'd'? 'Ss_'だけでなく... ...? – B00MER

答えて

0

モジュールの唯一の目的が書き換えである場合は、クラスグループ(global/blocks/ss_todaysevents)を設定する必要はありません。クラスを別のクラスグループ_クラス名に直接マッピングしています。

Magentoはテキストノードの空白を取り除きません。あなたのクラス名は、その周りに空白を持つべきではない、あなたのadminhtml_event_edit_formノード、すなわち:

<adminhtml_event_edit_form>Ss_TodaysEvents_Block_Adminhtml_Event_Edit_Form</adminhtml_event_edit_form>