Skip to content

Commit

Permalink
Merge pull request #3 from beryllium/undo-patch-3
Browse files Browse the repository at this point in the history
Revert "Update menu array on an item-by-item basis"
  • Loading branch information
janbuecker committed Feb 18, 2020
2 parents 2b6f786 + ff44568 commit 4658166
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions MenuGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,7 @@ public function beforeRun(SourceSetEvent $sourceSetEvent)
];
}

$menu = $this->buildMenu($pages);
foreach ($menu as $item) {
$key = array_search($item, $this->menu);

// if we have a hit, replace the matching menu item instead of appending
if (false !== $key) {
$this->menu[$key] = $item;
continue;
}

// fall back to appending unmatched items
$this->menu[] = $item;
}
$this->menu = $this->buildMenu($pages);

$this->setMenu($sourceSet);
}
Expand Down

0 comments on commit 4658166

Please sign in to comment.