Project

General

Profile

Actions

Bug #55739

closed

typoLink() does not consider additional params for external urls

Added by Markus Klein about 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2014-02-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #68328: Remove additional link params field from ElementBrowserClosed2015-07-18

Actions
Has duplicate TYPO3 Core - Bug #53729: Add additional link parameter for image links does not workClosed2013-11-18

Actions
Actions #1

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

Actions #2

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.

Actions #3

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
Actions #4

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!
Actions #5

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.

Actions #6

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.

Actions #7

Updated by Wouter Wolters over 8 years ago

  • Status changed from Accepted to Closed

closed on request

Actions #8

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.

Actions #9

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.

Actions

Also available in: Atom PDF