Skip to content

Commit

Permalink
Do not redirect to pretty url when crud controller is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb33300 committed Jan 14, 2025
1 parent 2d110c2 commit b9b399b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/EventListener/AdminRouterSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b9b399b

Please sign in to comment.