10

Magento 1.6 でカスタム SMS モジュールを開発しています。

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エラーが来るまで...

4

3 に答える 3

36

システム構成の 404 エラーは、多くの場合、ACL に問題があることを意味します。adminhtml.xmlモジュールのファイルに適切な 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>
</...>

上記を追加した後、完全な管理者ロールのユーザーに対してログアウトして再度ログインし、このロールをカスタムの管理者ユーザー ロールに明示的に追加する必要があります。

于 2011-12-06T17:47:02.047 に答える
2

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

于 2015-07-06T18:48:57.603 に答える