Skip to content

Commit 54ec493

Browse files
authored
Remove 0 values from trail
1 parent 916387c commit 54ec493

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Menu/NavigationModuleProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function get($name, array $options = []): ItemInterface
5858
} elseif (null === $currentPage) {
5959
throw new \RuntimeException('Current request does not have a page model. Please define the root page in the navigation module or pass the root page as option, i.e., knp_menu_get(\'contao\', { rootPage: 1 })');
6060
} else {
61-
$trail = $currentPage->trail;
61+
$trail = array_values(array_filter($currentPage->trail));
6262
$level = max($options['levelOffset'] ?? 0, 0);
6363
}
6464

0 commit comments

Comments
 (0)