Skip to content

Commit 1824663

Browse files
author
Stanislav Idolov
authored
ENGCOM-1921: Do not display anchor if admin submenu has no children #15933
2 parents 6db65b0 + 7c6fc56 commit 1824663

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,12 @@ protected function _renderItemCssClass($menuItem, $level)
211211
protected function _renderAnchor($menuItem, $level)
212212
{
213213
if ($level == 1 && $menuItem->getUrl() == '#') {
214-
$output = '<strong class="submenu-group-title" role="presentation">'
215-
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
216-
. '</strong>';
214+
$output = '';
215+
if ($menuItem->hasChildren()) {
216+
$output = '<strong class="submenu-group-title" role="presentation">'
217+
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
218+
. '</strong>';
219+
}
217220
} else {
218221
$output = '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
219222
$menuItem

0 commit comments

Comments
 (0)