2011-06-21 14 views
32

カスタムモジュールの設定をいくつか実装しようとしています。私は左側のナビゲーションバーにタブとセクションを追加することができました。しかし、私がセクションを開くときには、私は何も詳細情報なしで404エラーページを取得します。Magento system.xmlと404エラーが発生しました。

これまでのところ、私はそれを働かせようとしました..ブログや例などを読んでいましたが、私はエラーを見つけることができません。たぶんあなたの誰かが、私が間違っていることを私に説明することができます。

マイadminhtml.xml

<?xml version="1.0" ?> 
<config> 
    <resources> 
     <admin> 
      <children> 
       <system> 
        <children> 
         <config> 
          <children> 
           <tempest_section translate="title" module="Tempest"> 
            <title>Tempest</title> 
           </tempest_section> 
          </children> 
         </config> 
        </children> 
       </system> 
      </children> 
     </admin> 
    </resources> 
</config> 

マイ​​3210:

<?xml version="1.0"?> 

<config> 
    <modules> 
     <Polyvision_Tempest> 
      <version>0.1.0</version> 
     </Polyvision_Tempest> 
    </modules> 


    <global> 
     <helpers> 
      <Tempest> 
       <class>Polyvision_Tempest_Helper</class> 
      </Tempest> 
     </helpers> 
    </global>   

    <admin> 
     <routers> 
      <adminhtml> 
       <args> 
        <modules> 
         <tempest before="Mage_Adminhtml">Polyvision_Tempest_Adminhtml</tempest> 
        </modules> 
       </args> 
      </adminhtml> 
     </routers> 
    </admin> 


    <adminhtml> 
     <menu> 
      <menu1 translate="title" module="Tempest"> 
       <title>polyvision</title> 
       <sort_order>60</sort_order> 
       <children> 
        <menuitem1 module="Tempest"> 
         <title>Tempest - Export</title> 
         <action>adminhtml/tempest_main</action> 
        </menuitem1> 
       </children>     
      </menu1> 
     </menu> 
    </adminhtml>  

    <default> 
     <tempest> 
      <settings> 
       <export_directory>/tmp/</export_directory> 
      </settings> 
     </tempest> 
    </default> 
</config> 

マイsystem.xml

<?xml version="1.0" ?> 
<config> 
    <tabs> 
     <polyvision module="Tempest" translate="label"> 
      <label>polyvision</label> 
      <sort_order>100</sort_order> 
     </polyvision> 
    </tabs> 
    <sections> 
     <tempest_section module="Tempest" translate="label"> 
      <label>Tempest-Einstellungen</label> 
      <sort_order>200</sort_order> 
      <show_in_default>1</show_in_default> 
      <show_in_website>1</show_in_website> 
      <show_in_store>1</show_in_store> 
      <tab>polyvision</tab> 
      <groups> 
       <settings translate="label"> 
        <label>Settings</label> 
        <comment></comment> 
        <sort_order>10</sort_order> 
        <show_in_default>1</show_in_default> 
        <show_in_website>1</show_in_website> 
        <show_in_store>1</show_in_store> 
        <fields> 
         <export_directory translate="label tooltip comment"> 
          <label>My Custom Field</label> 
          <comment>Some comment about my field</comment> 
          <tooltip>Field ToolTip</tooltip> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>1</show_in_store> 
         <frontend_input>text</frontend_input> 
         <source_model>adminhtml/system_config_text</source_model> 
        </export_directory> 
       </fields> 
      </settings> 
     </groups> 
    </tempest_section> 
</sections> 

まあ、私のモジュール自体は面倒なく動作します。管理者設定だけが動作していません:/

答えて

71

それは管理コンソールのChromeで404だ場合、あなたの問題が不足しているACLの役割です。 this article on how to set one upを読んでください。 (自己リンク)

また、ACLロールを設定したら、Magentoセッションをクリアする必要があります。 Magentoは特定の役割をセッションにキャッシュし、新しいセッションはスーパーユーザー役割を持つユーザーのキャッシュに自動的に追加されません。

+1

Thanx!このサイトの例は、私の本やブログなどで見つけた他のすべてのものよりもはっきりしています。 – ghostrifle

+7

ありがとうアラン。/rantmodeこれは、あなたがセッションをクリアしなければならないことは信じられないが、それはどこにも書かれていない**です。私はこの単純な理由のために昨日約5時間頭を叩いていた。私が誤ってログアウトするとうまくいけば、なぜか.../endrantmodeまあ通常のMagentoの問題に戻る:) –

+3

私はACLの役割を作成する必要はありませんでしたが、しかし、私は 'rm -fr var/cache/* var/session/*'を実行していました。 Magento ... – bensnider

2

こんにちは私はconfig.xmlのアクションタグに何か問題があると思います。

<action>adminhtml/tempest_main</action> 

私は間違っていないよ場合、これはアプリ/コード/コア/メイジ/ Adminhtmlで見つかったadminhtmlモジュールを参照します。

あなたのモジュールの名前は何ですか?あなたのコントローラフォルダには何がありますか?

は、私はアクションの最初のビットは、あなたのコントローラの名前と、パス、あなたの管理コントローラとアクション

アクションタグは、次のように構築されていなければならないことを信じています。

<action>matrixrate/adminhtml_index/index</action> 
     |--module--|--controller---|-action-| 

HTH

+0

申し訳ありませんが、それはエラーではないようです。このアクションタグを変更すると、モジュールを開くことができなくなります。モジュールを使用することはこれまでのところ問題ありません。System/Configurationだけが動作しないので、設定パネルでpolyvision-TABを開きます。 – ghostrifle