b13/menus

[BUG] B13\Menus\Domain\Repository\MenuRepository->getBreadcrumbsMenu() won't respect excludedDoktypes

Closed this issue · 0 comments

I'm using B13\Menus\DataProcessing\BreadcrumbsMenu which uses B13\Menus\Domain\Repository\MenuRepository->getBreadcrumbsMenu() internally. But MenuRepository->getBreadcrumbsMenu() won't respect MenuRepository::$excludedDoktypes (I know it's not a static variable 😉) and won't remove the "Hauptmenü" folder from the rootLine.

Steps to reproduce

Have a folder inside the rootLine like this:
image

$GLOBALS['TSFE']->rootLine:

array (size=3)
  2 =>
    array (size=26)
      'pid' => int 118
      'uid' => int 7
      'title' => string 'News' (length=4)
      'nav_title' => string '' (length=0)
      'doktype' => int 1
  1 =>
    array (size=26)
      'pid' => int 1
      'uid' => int 118
      'title' => string 'Hauptmenü' (length=10)
      'nav_title' => string '' (length=0)
      'doktype' => int 254
  0 =>
    array (size=26)
      'pid' => int 0
      'uid' => int 1
      'title' => string 'root-page' (length=9)
      'nav_title' => string 'Startseite' (length=10)
      'doktype' => int 1

Actual result:

MenuRepository->getBreadcrumbsMenu():

array (size=3)
  0 => array
      'uid' => int 1
      'pid' => int 0
      'title' => string 'root-page' (length=9)
      'doktype' => int 1
      'nav_title' => string 'Startseite' (length=10)
      'hasSubpages' => boolean false
  2 => array
      'nav_title' => string 'Hauptmenü' (length=10)
      'hasSubpages' => boolean false
  1 => array
      'uid' => int 7
      'pid' => int 118
      'title' => string 'News' (length=4)
      'doktype' => int 1
      'nav_title' => string 'News' (length=4)
      'hasSubpages' => boolean false

Expected result:

MenuRepository->getBreadcrumbsMenu():

array (size=2)
  0 => array
      'uid' => int 1
      'pid' => int 0
      'title' => string 'root-page' (length=9)
      'doktype' => int 1
      'nav_title' => string 'Startseite' (length=10)
      'hasSubpages' => boolean false
  1 => array
      'uid' => int 7
      'pid' => int 118
      'title' => string 'News' (length=4)
      'doktype' => int 1
      'nav_title' => string 'News' (length=4)
      'hasSubpages' => boolean false

P.S. I think MenuRepository->getBreadcrumbsMenu() shouldn't add the hasSubpages value, because it will always be false.