Skip to content

Commit

Permalink
Add menu_item_location property to menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Apr 24, 2020
1 parent 019703b commit cc8ed17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bundle/Menu/Factory/LocationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public function createItem($name, array $options = []): ItemInterface

$menuItem
->setLabel($options['ezlocation']->content->name)
->setExtra('ezlocation', $options['ezlocation']);
->setExtra('ezlocation', $options['ezlocation'])
// Used to preserve the reference to the original menu item location
// (e.g. in case of menu item or shortcut where ezlocation will be overwritten
// by the location of related content)
->setExtra('menu_item_location', $options['ezlocation']);

$extension = $this->getExtension($options['ezlocation']);
$extension->buildItem($menuItem, $options['ezlocation']);
Expand Down

0 comments on commit cc8ed17

Please sign in to comment.