Skip to content

Commit 28f8492

Browse files
committed
Fix menu rendering when out of CRUD context (e.g. dashboard or custom pages)
1 parent f9907d4 commit 28f8492

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Factory/MenuFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ private function buildMenuItems(array $menuItems): array
9696
/**
9797
* @param MenuItemDto[] $subItems
9898
*/
99-
private function buildMenuItem(MenuItemDto $menuItemDto, array $subItems, string $translationDomain, CrudDto $crudDto): MenuItemDto
99+
private function buildMenuItem(MenuItemDto $menuItemDto, array $subItems, string $translationDomain, ?CrudDto $crudDto): MenuItemDto
100100
{
101101
if (!$menuItemDto->getLabel() instanceof TranslatableInterface) {
102102
$label = $menuItemDto->getLabel();
103-
if (null === $label && MenuItemDto::TYPE_CRUD === $menuItemDto->getType()) {
103+
if (null === $label && MenuItemDto::TYPE_CRUD === $menuItemDto->getType() && null !== $crudDto) {
104104
$label = Action::INDEX === $menuItemDto->getRouteParameters()[EA::CRUD_ACTION]
105105
? $crudDto->getEntityLabelInPlural()
106106
: $crudDto->getEntityLabelInSingular();

0 commit comments

Comments
 (0)