From b9b399b039d41b322fee9792b9a890f614a6b809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alfaiate?= Date: Tue, 14 Jan 2025 19:56:09 +0700 Subject: [PATCH] Do not redirect to pretty url when crud controller is null --- src/EventListener/AdminRouterSubscriber.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EventListener/AdminRouterSubscriber.php b/src/EventListener/AdminRouterSubscriber.php index c3f3430d16..ee9b094036 100644 --- a/src/EventListener/AdminRouterSubscriber.php +++ b/src/EventListener/AdminRouterSubscriber.php @@ -163,8 +163,7 @@ public function onKernelRequest(RequestEvent $event): void // if this is a ugly URL from legacy EasyAdmin versions and the application // uses pretty URLs, redirect to the equivalent pretty URL - if ($this->adminRouteGenerator->usesPrettyUrls()) { - $entityFqcnOrCrudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN); + if ($this->adminRouteGenerator->usesPrettyUrls() && null !== $entityFqcnOrCrudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN)) { if (is_subclass_of($entityFqcnOrCrudControllerFqcn, CrudControllerInterface::class)) { $crudControllerFqcn = $entityFqcnOrCrudControllerFqcn; } else {