Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Router/AdminUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down