Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 11, 2025
1 parent 7483cd6 commit 871ac6e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/EventListener/AdminRouterSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ public function onKernelRequestPrettyUrls(RequestEvent $event): void
// custom EasyAdmin route defaults/attributes to other existing Symfony routes. So, we have to
// check if the route of the current request matches any of the cached dashboard routes
$dashboardRoutesCachePath = $this->buildDir.'/'.CacheWarmer::DASHBOARD_ROUTES_CACHE;
$dashboardControllerRoutes = !file_exists($dashboardRoutesCachePath) ? [] : require $dashboardRoutesCachePath;
$dashboardControllerRoutes = [];
if (file_exists($dashboardRoutesCachePath)) {
$dashboardControllerRoutes = require $dashboardRoutesCachePath;
}
// this is not a cached dashboard route, so this is case (3) a regular Symfony request
if (!array_key_exists($request->attributes->get('_route'), $dashboardControllerRoutes)) {
if (!\array_key_exists($request->attributes->get('_route'), $dashboardControllerRoutes)) {
return;
}
}
Expand Down

0 comments on commit 871ac6e

Please sign in to comment.