404管理员中自定义Magento配置出错
我正在Magento 1.6中开发一个自定义短信模块 我已经设置了404管理员中自定义Magento配置出错,magento,adminhtml,Magento,Adminhtml,我正在Magento 1.6中开发一个自定义短信模块 我已经设置了system.xml文件来管理相关的自定义配置字段 菜单项显示出来,但当我单击它时,会显示404错误页面,而不是预期的配置字段列表 你能看到我的代码中有错误吗 <config> <tabs> <mynew_tab translate="label"> <label>SMS Gateway Integration</label> &l
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>
短信网关集成
100
短信网关集成
200
1.
1.
1.
我的新标签
我的自定义配置
这是自定义配置的示例。
10
1.
1.
1.
已启用
选择
adminhtml/system\u config\u source\u yesno
0
1.
1.
1.
启用此模块。
发件人电子邮件
文本
1.
1.
1.
1.
SMS网关的用户名。
发件人电子邮件
文本
1.
1.
1.
1.
短信网关的密码。
在ben的请求之后,我们放置了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错误出现之前…系统配置中的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>
</...>
你的部门
添加上述内容后,您将需要注销并重新登录完整的管理员角色用户,并将此角色明确添加到自定义管理员用户角色。不要低估注销并在更改ACL后重新登录的需要。即使您清除了缓存,在您注销并重新登录之前,您仍将执行404操作。按照@benmarks所说的做,并确保添加正确的子项(在您的情况下)
smsconfig
<!-- 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>
</...>
(@benmarks使用了sms_config
而不是smsconfig
)
因此,您的adminhtml.xml如下所示:
<!-- 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>
顺便说一句,我不知道这是在哪里出现的
我放置了adminhtml.xml文件并按照您的说明操作。但是直到404出错。你是对的,本,我的代码中有一些错误。现在它开始工作了。谢谢您的帮助。您必须断开连接才能生效。
应该是
,与部分下system.xml中使用的名称相同。已编辑。要找到确切的错误:这对我有效,请尝试此方法。请不要提供“仅链接”答案(如果远程站点上的页面被删除,会发生什么情况?)。如果外部内容相关,请将步骤/代码添加到您的答案中,您可以引用源代码作为额外注释。
<!-- 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>