Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento ACL操作标签原因';角色资源树&x27;在管理/系统/权限/角色中绘制错误_Magento - Fatal编程技术网

Magento ACL操作标签原因';角色资源树&x27;在管理/系统/权限/角色中绘制错误

Magento ACL操作标签原因';角色资源树&x27;在管理/系统/权限/角色中绘制错误,magento,Magento,我们在“sales_order/view”管理部分创建了类似于“hold”、“ship”和其他操作的新操作,单击按钮可以触发这些操作。之后,我们使用config.xml中的以下代码将新操作添加到ACL中: <acl> <resources> <admin> <children> <sales> <children

我们在“sales_order/view”管理部分创建了类似于“hold”、“ship”和其他操作的新操作,单击按钮可以触发这些操作。之后,我们使用config.xml中的以下代码将新操作添加到ACL中:

 <acl>  
   <resources>  
      <admin>  
          <children>  
              <sales>
                  <children>
                         <order>
                                <children>
                                    <actions translate="title">
                                        <title>Actions</title>
                                        <children>
                                            <shipNew translate="title"><title>Ship Ups</title></shipNew>
                                        </children>
                                    </actions>
                                </children>
                                <sort_order>10</sort_order>
                            </order>  
              </children>
                  </sales>  
                        </children>  
              </admin>
          </resources>  
       </acl>  

行动
船舶Ups
10
ACL功能可以工作,但是,在“角色资源树”(系统/权限/角色/角色资源)中,我们的新操作永远不会显示为选中(选中),即使它允许用于特定角色。我可以从表'admin_rule'中看到,对于我们的新操作,它是允许的,所以它需要显示为选中的,但它不是

当我试图解决这个问题时,我查看了模板(permissions/rolesedit.phtml),发现“角色资源树”是在Javascript的帮助下绘制的……这就是我在Javascript方面知识有限而陷入困境的地方

为什么角色资源树不能正确显示新的ACL条目,即复选框从未选中

谢谢你的帮助
玛戈特

我发现了这个问题

显然,acl标记的所有字母都必须小写,以便正确绘制“资源树”。一旦我将“shipNew”更改为“shipNew”,在管理->系统->权限->角色->角色资源中正确绘制“资源树”

正确的代码如下所示:

   <acl>   
     <resources>   
       <admin>   
        <children>  
           <sales>
            <order>
                 <children>
                         <actions>
                                    <children>
                                        <shipnew translate="title"><title>Ship Ups</title></shipnew>
                                    </children>
                                </actions>
                            </children>
                        </order>  
                   </children>
              </sales>  
           </children>  
          </admin>
      </resources>  
   </acl>  

船舶Ups
我还删除了似乎不必要的“标题”、“订单”标签

我希望这是有用的