Skip to content

Commit

Permalink
Update block.menus.inc
Browse files Browse the repository at this point in the history
Used #empty for another table
  • Loading branch information
kiamlaluno committed Dec 24, 2023
1 parent 283b1f7 commit 93d7f18
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions core/modules/dashboard/includes/block.menus.inc
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,10 @@ class DashboardMenuBlock extends Block {
}
}

if (empty($rows)) {
if (empty($rows) && !empty($menus)) {
// If there are existing menus, but user has no access to manage any of
// them, hide the block completely.
if (!empty($menus)) {
return;
}
$rows[] = array(
array(
'data' => t('There are no menus to display.'),
'colspan' => 4,
),
);
return;
}

$panel = array(
Expand All @@ -117,6 +109,7 @@ class DashboardMenuBlock extends Block {
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => t('There are no menus to display.'),
);

if (user_access('administer menu')) {
Expand Down

0 comments on commit 93d7f18

Please sign in to comment.