Project

General

Profile

Actions

Bug #14385

closed

HMENU special=language does not work if L in linkvars

Added by old_pneff about 20 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2004-11-13
Due date:
% Done:

0%

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

Description

The 3.7 language menu generates a faulty URL for language switch. When rendering a page with the L querystring in the URL (e.g. index.php?id=10&L=2), the links in the language menu contain two L query strings (e.g. index.php?id=10&L=2&L=1).

This seems to happend only then L is in config.linkVars.

I have created a small patch which fixes the problem. Basically it removes the existing L parameter from $GLOBALS['TSFE']->linkVars before rendering the language menu. This is probably fault, because it would at least have to backup $GLOBALS['TSFE']->linkVars and set it back to the backuped value after the menu is generated (I'm really just guessing here).
(issue imported from #M490)


Files

0000490-class.t3lib_tstemplate.php.diff (1.06 KB) 0000490-class.t3lib_tstemplate.php.diff Administrator Admin, 2005-03-24 17:52
class.tslib_content_2.diff (1.2 KB) class.tslib_content_2.diff Administrator Admin, 2005-04-06 22:22
class.t3lib_tstemplate_3.diff (1.17 KB) class.t3lib_tstemplate_3.diff Administrator Admin, 2005-04-07 13:53
class.t3lib_tstemplate_4.diff (1.05 KB) class.t3lib_tstemplate_4.diff Administrator Admin, 2005-04-07 13:53

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #15557: in relation to 0000490: HMENU special=language does not work if L in linkvarsClosed2006-02-02

Actions
Actions #1

Updated by Stefano Cecere about 20 years ago

i'd suggest to integrate the tt_news language_menu.php.. which solves problems with the GETvars, simulateStatics and realURL (also Satan's extesion does the same.. )

Actions #2

Updated by Stefano Cecere about 20 years ago

ops... i didn't absolutely wanted to write "Satan's"!!!
what a type-mistake :):)

maybe i wanted to write "Stan's" (referring to sr_language_menu ) :):)

ps: i'm absomutely not involved with any Satanic stuff aha ha ahah..

Actions #3

Updated by old_pneff almost 20 years ago

The new patch uploaded by fhengartner fixes a problem with my first approach. Can we hope to see this problem fixed anytime soon?

Actions #4

Updated by Stefan Geith over 19 years ago

No, I think the correction has to be done in class.t3lib_tstemplate.php, function linkData - Line 1326:
$LD['linkVars'] = $GLOBALS['TSFE']->linkVars.$addParams;
if '&L=' is included in $addParams, then the corresponding '&L=' in
$LD['linkVars'] must be replaced.

Something like:
$LD['linkVars'] = ..removeDoubleParam($GLOBALS['TSFE']->linkVars).
$addParams;

-

Stefan Geith, typo3dev(at)geithware.de

Actions #5

Updated by Stefan Geith over 19 years ago

The solution:
in class.t3lib_tstemplate.php, replace lines
1325 // linkVars
1326 $LD['linkVars'] = $GLOBALS['TSFE']->linkVars.$addParams;
with:
// linkVars
$lV = Array();
$tmp = explode ('&',$GLOBALS['TSFE']->linkVars);
while(list($k,$e)=each($tmp)) if ($e) {
list($k,$v) = explode('=',$e);
$lV[$k] = $v;
}
$tmp = explode ('&',$addParams);
while(list($k,$e)=each($tmp)) if ($e) {
list($k,$v) = explode('=',$e);
$lV[$k] = $v;
}
$LD['linkVars'] = t3lib_div::implodeArrayForUrl('',$lV);

Actions #6

Updated by Rupert Germann over 19 years ago

the fix from Stefan is working for me. I made a diff file from it and atached it to this bug.
the other patchfiles (13.11.04 and 09.02.05 ) are not working at all -> nothing changes
(tested on 3.7.0 and 3.8.0 dev)

Actions #7

Updated by Michael Stucki over 19 years ago

Removed two diff attachments because they did not really solve the problem!

Actions #8

Updated by Michael Stucki over 19 years ago

I just replied to Stefan Geiths post in typo3-dev:
If you are still interested to have this fixed, please write a new patch based on the diff by Rupi which solves the problem.

Please add the requested config options and submit it on the bugtracker including some additional TSref description lines.

- michael

Actions #9

Updated by Rupert Germann over 19 years ago

I added a new patch which does the same as before, but now the use of the fix is configurable.

config.uniqueLinkVars = 1

will enable it.

Actions #10

Updated by Michael Stucki over 19 years ago

Thanks, Rupi. Will do that and confirm when done.

Actions #11

Updated by Rupert Germann over 19 years ago

the patch named (class.t3lib_tstemplate_3.diff) should need not so much processing time as the patches before.
I reduced it to 1 while loop and added a condition that ckecks if '$addParams' has a value before doing anything. This executes the the 'parameter-cleaning' only for the links from the language menu.
IMO the additional config parameter 'uniqueLinkVars' is now not needed anymore because the additional processing is only done with a few links. (I added this as patch class.t3lib_tstemplate_4.diff)

what so you think ?

Actions #12

Updated by Michael Stucki over 19 years ago

Hmm, finally found where this information belongs to (previously posted it in the wrong bug entry by mistake)

====

Kasper wrote:
- I wouild like the explode function to us ",2" as third parameter -
just to make sure it splits on only the first found "=". Only a
theoretical thing.

I agree with this. Changed it already on my local copy of the patch, so this is just for your information.

====

I'm still waiting for Kaspers go but think it should be fine to add it like you suggested in the patch which enables the feature by default (= no config option).

Actions #13

Updated by Michael Stucki over 19 years ago

Fixed in CVS

Actions

Also available in: Atom PDF