From f83834936a2a8a0eb02eca800ca485d505148015 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 7 Aug 2023 20:30:36 +0200 Subject: [PATCH] Revert the check of the route name --- src/Factory/AdminContextFactory.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Factory/AdminContextFactory.php b/src/Factory/AdminContextFactory.php index cbaa810be1..c242e3e1c9 100644 --- a/src/Factory/AdminContextFactory.php +++ b/src/Factory/AdminContextFactory.php @@ -73,13 +73,9 @@ private function getDashboardDto(Request $request, DashboardControllerInterface $dashboardControllerRoutes = !file_exists($dashboardRoutesCachePath) ? [] : require $dashboardRoutesCachePath; $dashboardController = $dashboardControllerInstance::class.'::index'; $dashboardRouteName = null; - $currentRouteName = $request->attributes->get('_route'); foreach ($dashboardControllerRoutes as $routeName => $controller) { - // checking if the route name matches is needed because the same - // dashboard controller can be associated to more than one route - // (see https://github.com/EasyCorp/EasyAdminBundle/pull/5853) - if ($controller === $dashboardController && $currentRouteName === $routeName) { + if ($controller === $dashboardController) { // if present, remove the suffix of i18n route names (it's a two-letter locale at the end // of the route name; e.g. 'dashboard.en' -> remove '.en', 'admin.index.es' -> remove '.es') $dashboardRouteName = preg_replace('~\.\w{2}$~', '', $routeName);