Skip to content

Commit b9b399b

Browse files
committed
Do not redirect to pretty url when crud controller is null
1 parent 2d110c2 commit b9b399b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/EventListener/AdminRouterSubscriber.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ public function onKernelRequest(RequestEvent $event): void
163163

164164
// if this is a ugly URL from legacy EasyAdmin versions and the application
165165
// uses pretty URLs, redirect to the equivalent pretty URL
166-
if ($this->adminRouteGenerator->usesPrettyUrls()) {
167-
$entityFqcnOrCrudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN);
166+
if ($this->adminRouteGenerator->usesPrettyUrls() && null !== $entityFqcnOrCrudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN)) {
168167
if (is_subclass_of($entityFqcnOrCrudControllerFqcn, CrudControllerInterface::class)) {
169168
$crudControllerFqcn = $entityFqcnOrCrudControllerFqcn;
170169
} else {

0 commit comments

Comments
 (0)