Skip to content

Commit

Permalink
[BUGFIX] Allow additional parameters in static routes
Browse files Browse the repository at this point in the history
If the static route value is using additionalParams, they should
be added to the page that is fetched.

The patch parses the "parameters" key (&my=value&key=1) into
additional parameters of the PageRouter.

Resolves: #87087
Releases: master, 9.5
Change-Id: I8688e891d1b6bfda3a546eb13812bbb80dfea1c1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62891
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Susanne Moog <look@susi.dev>
  • Loading branch information
bmack authored and susannemoog committed Jan 15, 2020
1 parent a18e953 commit 58e3463
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -120,9 +120,16 @@ protected function getFromUri(string $uri): array
*/
protected function getPageUri(ServerRequestInterface $request, Site $site, array $urlParams): string
{
$parameters = [];
// Add additional parameters, if set via TypoLink
if (isset($urlParams['parameters'])) {
parse_str($urlParams['parameters'], $parameters);
}
$parameters['type'] = $urlParams['pagetype'] ?? 0;
$parameters['_language'] = $request->getAttribute('language', null);
$uri = $site->getRouter()->generateUri(
(int)$urlParams['pageuid'],
['type' => $urlParams['pagetype'] ?? 0, '_language' => $request->getAttribute('language', null)],
$parameters,
'',
RouterInterface::ABSOLUTE_URL
);
Expand Down

0 comments on commit 58e3463

Please sign in to comment.