Adding menu.xml in a new magento 2.1.3 installation causes redirect loop in the admin
I am creating a new module, but when tried to add menu.xml in etc/adminhtml directory in the module directiory, the browser shows error of redirect loop Magento Version: Magento CE 2.1.3 Mysql Version: 5.6.28 PHP version: 7.0.8
Steps to reproduce issue 1. Install new Magento CE 2.1.3 2. Create new module in app/code with all required files in etc directory of the module 3. Add menu.xml and add items in the menu
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Ktpl_Testimonial::menu" title="IntroBrand" translate="title" module="Ktpl_Testimonial" sortOrder="0" resource="Ktpl_Testimonial::menu"/>
<add id="Ktpl_Testimonial::testimonial" title="Manage Testimonials" translate="title" module="Ktpl_Testimonial" sortOrder="0" parent="Ktpl_Testimonial::menu" resource="Ktpl_Testimonial::testimonial"/>
</menu>
</config>
Edit
Added acl.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Ktpl_Testimonial::menu">
<resource id="Ktpl_Testimonial::testimonial"/>
</resource>
</resource>
</resources>
</acl>
</config>
Expected result
It should add a main menu item in the admin menu and a child menu item in the new menu item.
Actual result
It creates a redirect loop when try to log in to the admin
screenshot from 2017年01月19日 12 44 34
-
have you enable module Ktpl_IntroBrand?Rakesh Jesadiya– Rakesh Jesadiya2017年01月19日 07:23:46 +00:00Commented Jan 19, 2017 at 7:23
-
Might be issue in resource Ktpl_IntroBrandRakesh Jesadiya– Rakesh Jesadiya2017年01月19日 07:24:13 +00:00Commented Jan 19, 2017 at 7:24
-
Yes, i have enabled the module rakesh.Taral Patoliya– Taral Patoliya2017年01月19日 07:24:43 +00:00Commented Jan 19, 2017 at 7:24
-
I have added the acl.xmlTaral Patoliya– Taral Patoliya2017年01月19日 07:26:48 +00:00Commented Jan 19, 2017 at 7:26
-
Try with <add id="Ktpl_Testimonial::testimonial" title="Manage Testimonials" translate="title" module="Ktpl_Testimonial" sortOrder="0" parent="Ktpl_Testimonial::menu" resource="Ktpl_Testimonial::testimonial"/>Rakesh Jesadiya– Rakesh Jesadiya2017年01月19日 07:28:01 +00:00Commented Jan 19, 2017 at 7:28
1 Answer 1
Try to set resource of root item to Magento_Backend::content