Skip to content

Commit 5b0b876

Browse files
authored
Fix set current route parameters with pretty urls enabled
1 parent 8dca478 commit 5b0b876

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Router/AdminUrlGenerator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ private function initialize(): void
364364
$this->currentPageReferrer = null;
365365
} else {
366366
$this->dashboardRoute = $adminContext->getDashboardRouteName();
367-
$currentRouteParameters = $routeParametersForReferrer = $adminContext->getRequest()->query->all();
367+
$routeParams = $adminContext->getRequest()->attributes->get('_route_params', []);
368+
unset($routeParams[EA::ROUTE_CREATED_BY_EASYADMIN]);
369+
$currentRouteParameters = $routeParametersForReferrer = array_merge($routeParams, $adminContext->getRequest()->query->all());
368370
unset($routeParametersForReferrer[EA::REFERRER]);
369371
$this->currentPageReferrer = sprintf('%s%s?%s', $adminContext->getRequest()->getBaseUrl(), $adminContext->getRequest()->getPathInfo(), http_build_query($routeParametersForReferrer));
370372
}

0 commit comments

Comments
 (0)