diff --git a/src/Router/AdminUrlGenerator.php b/src/Router/AdminUrlGenerator.php index 0f7ad7e50f..c8dd5c7c07 100644 --- a/src/Router/AdminUrlGenerator.php +++ b/src/Router/AdminUrlGenerator.php @@ -288,11 +288,14 @@ public function generateUrl(): string // if no route parameters are passed, the route doesn't point to any CRUD controller // action or to any custom action/route; consider it a link to the current dashboard if ([] === $routeParameters) { + $this->isInitialized = false; + return $this->urlGenerator->generate($this->dashboardRoute, [], $urlType); } if (null !== $routeName = $this->get(EA::ROUTE_NAME)) { $adminRoutes = $this->cache->getItem(AdminRouteGenerator::CACHE_KEY_ROUTE_TO_FQCN)->get(); + $this->isInitialized = false; if (null !== $adminRoutes && \array_key_exists($routeName, $adminRoutes)) { return $this->urlGenerator->generate($routeName, $routeParameters[EA::ROUTE_PARAMS] ?? [], $urlType); }