Skip to content

Commit 3d9d9fe

Browse files
authored
Fix issue where menu items with nesting=true wouldn't resolve their own URL
This fixes an issue introduced in 2d73dd2 where if the item had the nesting property set to true it would remove all previous data resolved about the individual item. This had the effect of replacing the menu item's URL with the URL for the first child under that menu item.
1 parent 338338e commit 3d9d9fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

classes/Page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ public static function resolveMenuItem(object $item, string $url, Theme $theme):
806806
}
807807

808808
if ($item->nesting || $item->type == 'all-static-pages') {
809-
$result = [
809+
$result = array_merge($result ?? [], [
810810
'items' => [],
811-
];
811+
]);
812812

813813
$iterator = function ($items) use (&$iterator, &$tree, $url, $getLocalizedUrls) {
814814
$branch = [];

0 commit comments

Comments
 (0)