diff --git a/bundle/Menu/Factory/LocationFactory.php b/bundle/Menu/Factory/LocationFactory.php index e8feef84..1ab93a2f 100644 --- a/bundle/Menu/Factory/LocationFactory.php +++ b/bundle/Menu/Factory/LocationFactory.php @@ -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']);