[TYPO3-dev] bug with typolink?

Steffen Kamper info at sk-typo3.de
Sat Aug 30 17:23:50 CEST 2008


Steffen Kamper schrieb:
> Dmitry Dulepov [typo3] schrieb:
>> Hi!
>>
>> Steffen Kamper wrote:
>>> it seems that uniqueLinkVars and addQueryString together don't work 
>>> proper, as id will be double in link, it produces links like
>>> index.php?id=14&S=2&id=14
>>
>> I did not notice that. I use addQueryString in comments ext and it 
>> never added a second copy of id.
>>
> Hi,
> 
> after examine i think the problem is in t3lib_tstemplate where this is 
> done:
> 
> if ($GLOBALS['TSFE']->config['config']['uniqueLinkVars']) {
>   if ($addParams) {
>     $LD['linkVars'] = 
> t3lib_div::implodeArrayForUrl('',t3lib_div::explodeUrl2Array($GLOBALS['TSFE']->linkVars.$addParams)); 
> 
> ...
> 
> so having addParams all given params of url are added to linkVars, also 
> id which is part of the url
> 
> vg Steffen

I fixed it by stripping id from addParams with uniqueLinkVars:

if ($GLOBALS['TSFE']->config['config']['uniqueLinkVars']) {
   if ($addParams) {
      $linkArray = 
t3lib_div::explodeUrl2Array($GLOBALS['TSFE']->linkVars . $addParams);
      unset($linkArray['id']);
      $LD['linkVars'] = t3lib_div::implodeArrayForUrl('', $linkArray);

if noone object on this i will create a patch

vg Steffen




More information about the TYPO3-dev mailing list