View Issue Details

IDProjectCategoryView StatusLast Update
0007741OXID eShop (all versions)2. ----- eShop backend (admin) -----public2024-11-08 14:08
Reportertode Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version7.1.0 
Summary0007741: Opened admin navigation entries are not closing when other subnavigation entries are opened (with more than one main navigation)
DescriptionDefault: If a main menu is opened in the navigation sidebar in the OXID Admin menu, already opened main menus are automatically closed.

Problem in OXID 7.x:
If another (ox)menu is created via menu.xml, its main menus are not closed automatically.
The reason lies in the new structure of navigation.html.twig. The ‘nav-x’ ids of the main menus for defined menus are doubled because the menu counter in the menu loop is reset to 0 for each additional menu. The JS for closing the menus cannot process the IDs uniquely.

The structure in navigation.tpl up to OXID 6.5 is fundamentally different and the above-mentioned problem does not occur here.

Suggested solution:
The following adaptation of navigation.html.twig
- Remove line 40 ({% set menuIndex = 0 %})

- Replace lines 3 and 4:
old:
{% set historyMenu = ‘nav-2’ %}
{% set favouritesMenu = ‘nav-3’ %}
new:
{% set historyMenu = ‘nav-’ ~ (menuCount + 1) %}
{% set favouritesMenu = ‘nav-’ ~ (menuCount + 2) %}

- Insert the following before line 1:
{% set menuCount = menustructure.count() %}
{% set menuIndex = 0 %}
Steps To ReproduceIn the menu.xml (standard or via module), create another OXMENU entry (menu) with several MAINMENU (main menus) and at least one SUBMENU (submenu) per main menu.

In OXID Admin, click on a new main menu entry from the new menu and open it.
Then click on another main menu entry (whether from the standard or new menu) and open it.

The previously opened new main menu entry from the new menu does not close.
TagsAdmin, Admin Template, Menu, Navigation
Attached Files
oxid-admin-menu-bug.png (20,683 bytes)   
oxid-admin-menu-bug.png (20,683 bytes)   
ThemeNot defined
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities