Bug #55739
closedtypoLink() does not consider additional params for external urls
0%
Description
The link wizard offers a field to specify additional link parameters.
This is encoded as fifth part into the link field.
When the link is rendered via ContentObjectRenderer::typoLink() this fifth part is evaluated but never used.
Affected are 6.0+ (did not check 4.x)
Reproduction
- Use the link wizard on any content element (for instance header)
- Set External URL
- Set some additional parameter
Result
The additional params do not show up anywhere
Code
The code is evaluated here:
if (isset($link_paramA[4]) && strlen(trim($link_paramA[4])) > 0) {
$forceParams = trim($link_paramA[4]);
// params value
$conf['additionalParams'] .= $forceParams[0] == '&' ? $forceParams : '&' . $forceParams;
}
But $conf['additionalParams']
is never used in the if body starting from line 5854.
Files
Updated by Witali Rott about 9 years ago
I made some changes in the GeneralUtility Class and add 4 new Methods (parseUrl, buildUrl, buildUrlQuery and mergeUrlQuery) to make it easier to work with URLs.
And changes in the ContentObjectRenderer Class make it posible to add params on a external url.
Maybe it's a good idea to write a own class for URLs. parse_url is a good approach.
http://php.net/manual/de/function.parse-url.php
Updated by Markus Klein about 9 years ago
Can you please push the patch to our review system and against master branch?
Infos about how to contribute: http://wiki.typo3.org/CWT
Thanks.
Updated by Benni Mack over 8 years ago
- Target version changed from next-patchlevel to 7.4 (Backend)
- Sprint Focus set to On Location Sprint
Updated by Jo Hasenau over 8 years ago
Just to clarify that: It is supposed to be that way according to TSref
http://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Typolink/Index.html
Note: This is only active for internal links!
Updated by Jo Hasenau over 8 years ago
IMHO this is due to the fact, that external URLs already contain all the necessary parameters.
So there is no link to be calculated before adding the parameters, which makes additionalParams useless here.
Updated by Marc Willmann over 8 years ago
Link handling in current master seems to works absolutely as expected - for internal links it works and for external links it shouldn't. I see no bug here.
Updated by Witali Rott over 8 years ago
It's needed to allow to link to urls for search query like search.com?q=test or similar.
At moment you can't even link on a external Typo3 Page without realurl.
Updated by Markus Klein over 8 years ago
- Target version deleted (
7.4 (Backend)) - Sprint Focus deleted (
On Location Sprint)
Reconsidering this one I agree that adding additional parameters should be done by simply adding those to the url.
I will create a new ticket to simply remove that field from there.