Skip to content

Commit 15769ec

Browse files
committed
fix(AdminUrlGenerator): unitialize before early returns
1 parent f74d74f commit 15769ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Router/AdminUrlGenerator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,14 @@ public function generateUrl(): string
288288
// if no route parameters are passed, the route doesn't point to any CRUD controller
289289
// action or to any custom action/route; consider it a link to the current dashboard
290290
if ([] === $routeParameters) {
291+
$this->isInitialized = false;
292+
291293
return $this->urlGenerator->generate($this->dashboardRoute, [], $urlType);
292294
}
293295

294296
if (null !== $routeName = $this->get(EA::ROUTE_NAME)) {
295297
$adminRoutes = $this->cache->getItem(AdminRouteGenerator::CACHE_KEY_ROUTE_TO_FQCN)->get();
298+
$this->isInitialized = false;
296299
if (null !== $adminRoutes && \array_key_exists($routeName, $adminRoutes)) {
297300
return $this->urlGenerator->generate($routeName, $routeParameters[EA::ROUTE_PARAMS] ?? [], $urlType);
298301
}

0 commit comments

Comments
 (0)