magento2: Parent menu not shown when there's only 1 submenu in admin panel

Preconditions

  1. Magento EE 2.2.1 & Magento EE 2.2.2

Steps to reproduce

  1. Create a module

  2. Create a new file menu.xml in folder adminhtml

  3. Create new menu like this `

    <add id="Footballexperience_Base::base" title="FExperience" module="Footballexperience_Base" sortOrder="20" resource="Magento_Customer::customer"/>

     <add id="Footballexperience_Base::manage_stadiums"
          title="Manage Stadiums"
          module="Footballexperience_Base"
          sortOrder="10"
          parent="Footballexperience_Base::base"
          resource="Footballexperience_Base::manage_stadiums"
     />
    
     <add id="Footballexperience_Base::stadiums"
          title="Stadiums"
          module="Footballexperience_Base"
          sortOrder="10"
          resource="Footballexperience_Base::stadiums"
          parent="Footballexperience_Base::manage_stadiums"
          action="febase/stadium/grid"
     />
    

`

Repository test

https://github.com/hi-rafa/magento2test221

Expected result

When you click the new menu added you should see inside a submenu like this Manage Stadiums -> Stadiums

screen shot 2018-02-17 at 5 33 42 pm

Actual result

What you actually see is only the menu Stadiums unless you add more than one submenu.

screen shot 2018-02-17 at 5 23 19 pm

Additional information

If you add 2 submenus it will work

screen shot 2018-02-17 at 5 20 45 pm

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (16 by maintainers)

Most upvoted comments

@hi-rafa This is actually a feature. This behavior and was added by this commit https://github.com/magento/magento2/commit/d91e96b529e70dcec55d3b5336b471791dc42d54, please check. so I’m closing this issue