2011-12-06 9 views
10

Magento 1.6でカスタムSMSモジュールを開発しています。管理者のカスタムMagento設定で404エラー

関連するカスタム設定フィールドを管理するためにsystem.xmlファイルをセットアップしました。

メニュー項目が表示されますが、クリックすると、予想される設定フィールドリストの代わりに404エラーページが表示されます。

私のコードに間違いがありますか?ベンの要求後

<config> 
<tabs> 
    <mynew_tab translate="label"> 
     <label>SMS Gateway Integration</label> 
     <sort_order>100</sort_order> 
    </mynew_tab> 
</tabs> 
<sections> 
    <smsconfig translate="label"> 
     <label>SMS Gateway Integration</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>mynew_tab</tab> 
     <groups> 
      <sms_group translate="label"> 
       <label>My Custom Configurations</label> 
       <comment>This is example of custom configuration.</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> 
        <sms_enabled translate="label tooltip comment"> 
         <label>Is Enabled</label> 
         <frontend_type>select</frontend_type> 
         <source_model>adminhtml/system_config_source_yesno</source_model> 
         <sort_order>0</sort_order> 
         <show_in_default>1</show_in_default> 
         <show_in_website>1</show_in_website> 
         <show_in_store>1</show_in_store> 
         <comment>Enable this module.</comment> 
        </sms_enabled> 
        <sms_username translate="label tooltip comment"> 
         <label>Sender Email</label> 
         <frontend_type>text</frontend_type> 
         <sort_order>1</sort_order> 
         <show_in_default>1</show_in_default> 
         <show_in_website>1</show_in_website> 
         <show_in_store>1</show_in_store> 
         <comment>Username of the SMS gateway.</comment> 
        </sms_username> 
        <sms_password translate="label tooltip comment"> 
         <label>Sender Email</label> 
         <frontend_type>text</frontend_type> 
         <sort_order>1</sort_order> 
         <show_in_default>1</show_in_default> 
         <show_in_website>1</show_in_website> 
         <show_in_store>1</show_in_store> 
         <comment>Password of the SMS gateway.</comment> 
        </sms_password> 
       </fields> 
      </sms_group> 
     </groups> 
    </smsconfig> 
</sections> 

、我々はadminhtml.xmlファイルを置きました。私はXMLファイルのコンテンツを配置しました。

<config> 
<acl> 
    <resources> 
     <admin> 
      <children> 
       <system> 
        <children> 
         <config> 
          <children> 
           <sms translate="title" module="sms"> 
            <title>SMS Gateway Section</title> 
           </sms> 
          </children> 
         </config> 
        </children> 
       </system> 
      </children> 
     </admin> 
    </resources> 
</acl> 

しかし、404エラーが来るまで...システム構成で

+0

f正確なエラーを示してください:これは私のために働いたhttp://pradhab.blogspot.com/2013/03/magento-404-error.htmlこれを試してください –

+1

"リンクのみ"の回答を提供しないでください(ページリモートサイトではダウンしていますか?)。外部コンテンツが関連している場合は、ステップ/コードを回答に追加して、ソースを余分なメモとして引用することができます。 – newfurniturey

答えて

36

404エラーは、多くの場合、ACLとの問題があることを意味します。ログアウトして、完全な管理ロールのユーザーのために再びログインし、明示的にカスタム管理ユーザーの役割にこの役割を追加する必要がありますあなた以上追加した後

<acl> 
    <resources> 
     <admin> 
      <children> 
       <system> 
        <children> 
         <config> 
          <children> 
           <smsconfig> <!-- translate="title" module="sms_config" if appropriate and depending on config --> 
            <title>Your Section</title> 
</...> 

:あなたはおそらく、あなたのモジュールのadminhtml.xmlファイルに適切なACLのノードが欠落しています。

+0

私はadminhtml.xmlファイルを配置し、あなたの指示に従いました。しかしそれまで404エラー。 –

+0

どこかでコードをペーストできますか? – benmarks

+1

あなたは正しいベンです、私は自分のコードにいくつかのバグがあります。今それは働いていた。ご協力いただきありがとうございます。 –

2

ACL変更後にログアウトしてから再度ログインする必要性を過小評価しないでください。あなたのキャッシュをクリアしても、あなたはあなたがログアウトし、再度ログインします。

3

言っ@benmarks何をプラス(お使いの場合には)smsconfig

(@benmarksを右子を追加してくださいまだ404になるまで、代わりに

<!-- namespace/modulename/etc/adminhtml.xml --> 
<acl> 
    <resources> 
     <admin> 
      <children> 
       <system> 
        <children> 
         <config> 
          <children> 
           <smsconfig> <!-- translate="title" module="sms_config" if appropriate and depending on config --> 
            <title>Your Section</title> 
</...> 

明確なキャッシュ、管理者ログアウト、管理者のログイン==)smsconfigの使用sms_config

ヒントに動作します:あなたはtでの404の外観を取得する場合彼は、URL(あなたのタブをクリック):

<!-- namespace/modulename/etc/system.xml --> 
<?xml version="1.0"?> 
<config> 
    <tabs> 
     <mymodulename translate="label" module="mymodulename"> 
      <label>MyModuleName Awesome Label</label> 
      <sort_order>1</sort_order> 
     </mymodulename> 
    </tabs> 
    <sections> 
     <mymodulename_something translate="label" module="mymodulename"> 
<!-- ... --> 

ので、あなたのadminhtml.xmlは、次のようになります。

​​

このURL mymodulename_somethingをポイントているようです。

<!-- namespace/modulename/etc/adminhtml.xml --> 
<?xml version="1.0"?> 
<config> 
    <acl> 
     <resources> 
      <admin> 
       <children> 
        <system> 
         <children> 
          <config> 
           <children> 
            <mymodulename_something translate="title" module="mymodulename"> 
             <title>have no idea where this is showing up btw</title> 
            </mymodulename_something> 
           </children> 
          </config> 
         </children> 
        </system> 
       </children> 
      </admin> 
     </resources> 
    </acl> 
</config> 
関連する問題