[TYPO3-english] AOE realurl sometimes generates wrong paths for default language
Max Herold
xhomezone-typo3 at yahoo.de
Thu Jun 3 12:14:01 CEST 2010
Hi,
we have Typo3 4.2.12 running with multiple languages in one page tree on
a single domain, realurl 1.5.2 and aoe_realurlpath 0.1.16. Default
language is German (L=0), English pages have L=1 mapped to an 'en/' path
prefix. Paths are correctly stored in the AOE path cache table in both languages.
In some cases, during the 'encode' lookup for a German page, AOE incorrectly
returns the English translation for the path. Realurl handles the path
prefix correctly in such cases (none, meaning German). It seems to
happen when a HTTP request to an English page triggers the generation of
a URL to any German page.
Example:
Let's assume a HTTP Request to "/en/english.html" triggers the
generation of the path to the same page in German; but instead of
"/deutsch.html", the path returned by AOE is "/english.html".
I suspect the problem might be in
tx_aoerealurlpath_pagepath._getLanguageVar():
function _getLanguageVar ()
{
$lang = 0;
// Setting the language variable based on GETvar in URL which
has been configured to carry the language uid:
if ($this->conf['languageGetVar']) {
$lang =
intval($this->pObj->orig_paramKeyValues[$this->conf['languageGetVar']]);
// Might be excepted (like you should for CJK cases which
does not translate to ASCII equivalents)
if (t3lib_div::inList($this->conf['languageExceptionUids'],
$lang)) {
$lang = 0;
}
}
if ($lang == 0) {
$lang = intval(t3lib_div::_GP('L'));
if ($lang == 0) {
$lang = intval($this->pObj->getRetrievedPreGetVar('L'));
}
}
return $lang;
}
While realurl expects "0" and orig_paramKeyValues['L']=="0" (German),
this AOE function returns "1" (English) because the HTTP requested page
was English, and thus _GP('L')==1. I'm not really sure about the value
of getRetrievedPreGetVar('L').
Am I missing something (maybe that it's more likely a wrong configuration) or is this a bug? (Might be related to #10237.)
Thanks a lot in advance!
Max
More information about the TYPO3-english
mailing list