管理员中的自定义Magento配置中出现404错误 [英] 404 error in Custom Magento configuration in admin

查看:82
本文介绍了管理员中的自定义Magento配置中出现404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Magento 1.6中开发自定义SMS模块.

I'm developing a custom SMS module in Magento 1.6.

我已经设置system.xml文件来管理相关的自定义配置字段.

I've setup the system.xml file to manage the related custom configuration fields.

出现菜单项,但是当我单击它时,将显示404错误页面,而不是预期的配置字段列表.

The menu entry shows up, but when I click it, a 404 error page is shown instead of the expected configuration fields list.

您可以在我的代码中看到任何错误吗?

Can you see any errors in my code?

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

在ben请求之后,我们放置了adminhtml.xml文件.我放置了XML文件的内容.

After ben's request, we placed the adminhtml.xml file. I placed the content of the XML file.

<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错误...

But till the 404 error comes...

推荐答案

系统配置中出现404错误通常表示ACL存在问题.您可能在模块的adminhtml.xml文件中缺少相应的acl节点:

A 404 error in system configuration often means that there is an issue with ACL. You are likely missing the appropriate acl node in your module's adminhtml.xml file:

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

添加上述内容后,您将需要注销并重新登录以拥有完整的管理员角色用户,并将该角色明确添加到自定义管理员用户角色中.

After adding the above you will need to log out and log back in for full admin role users and explicitly add this role to custom admin user roles.

这篇关于管理员中的自定义Magento配置中出现404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆