Skip to content

Commit 3179481

Browse files
committed
bug #6717 Do not redirect to pretty url when crud controller is null (Seb33300)
This PR was merged into the 4.x branch. Discussion ---------- Do not redirect to pretty url when crud controller is null Fixes #6707 Commits ------- b9b399b Do not redirect to pretty url when crud controller is null
2 parents 91a4e28 + b9b399b commit 3179481

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)