From 6d2e78ce550a7b637c1205001f275fb3285d13c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Oct 2025 12:00:51 +0200 Subject: [PATCH] Fix parameter handling in `MenuComposer` and `MenuTwig` - Corrected `routeParameters` assignment in `MenuComposer` for proper parameter usage. - Adjusted `menus` and `routes` assignment order in `MenuTwig` for consistent handling. --- src/Bundle/ChillMainBundle/Routing/MenuComposer.php | 2 +- src/Bundle/ChillMainBundle/Routing/MenuTwig.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php index 101a97f6e..4386a765b 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php @@ -43,7 +43,7 @@ final readonly class MenuComposer foreach ($routes as $order => $route) { $menu->addChild($this->translator->trans($route['label']), [ 'route' => $route['key'], - 'routeParameters' => $parameters['args'], + 'routeParameters' => $parameters, 'order' => $order, ]) ->setExtras([ diff --git a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php index 409dcca11..f087c4aaa 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php @@ -51,8 +51,8 @@ final class MenuTwig extends AbstractExtension $layout = $resolvedParams['layout']; unset($resolvedParams['layout']); - - $resolvedParams['menus'] = $resolvedParams['routes'] = $this->menuComposer->getMenuFor($menuId, $resolvedParams['args']); + $resolvedParams['routes'] = $this->menuComposer->getMenuFor($menuId, $resolvedParams['args']); + $resolvedParams['menus'] = $resolvedParams['routes']; return $env->render($layout, $resolvedParams); }