From f8ba14cb1db4b92ed60e16df1f9abdcc2b1a06a5 Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Fri, 28 Oct 2022 12:58:26 +0200 Subject: [PATCH] Pass other `_route_params` into a forwarded request --- src/Controller/Frontend/ListingController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/Frontend/ListingController.php b/src/Controller/Frontend/ListingController.php index 07f07857d..a2070ae0b 100644 --- a/src/Controller/Frontend/ListingController.php +++ b/src/Controller/Frontend/ListingController.php @@ -69,7 +69,10 @@ public function listing(ContentRepository $contentRepository, string $contentTyp $route = $content->getDefinition()->get('record_route'); $controller = $this->container->get('router')->getRouteCollection()->get($route)->getDefault('_controller'); - return $this->forward($controller, ['slugOrId' => $content->getId()]); + $parameters = $this->request->attributes->all(); + $parameters['slugOrId'] = $content->getId(); + + return $this->forward($controller, $parameters); } $records = $this->setRecords($content, $amountPerPage, $page);