Bug #88963

RedirectService is not taking additional parameters

Added by Manfred Mirsch about 1 month ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Start date:
2019-08-15
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

When using additinal parameters in typolink as link target these parameters are not appended in redirect.

E.g. my link target as typolink is:
t3://page?uid=2 - - - q=support

When I add this as link target in redirect entry, I can see the correct link generated in Redirects backend module in column "destination".

But klicking the preview or entering the source_url, the additional parameter "q=support" is not used.

I found the problem in \TYPO3\CMS\Redirects\Service\RedirectService::getTargetUrl().

Because the source_path itself has no query parameters, they are not commited when this method is called at:
TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler::process()
#60 $url = $redirectService->getTargetUrl($matchedRedirect, $request->getQueryParams(), $request->getAttribute('site', null));

I found a solution for fixing this problem by adding additional parameters from target typolink which I add.

Greetings,
Manfred MIrsch

RedirectService.patch View (1.01 KB) Manfred Mirsch, 2019-08-15 20:19

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61509

#2 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61509

#3 Updated by Guido Schmechel about 1 month ago

Hi Manfred,

thanks for your findings. I add your patch with a test to the review system. Feel free to optimize.

Also available in: Atom PDF