[TYPO3-english] getTypoLink_URL generates wrong URL after language change

Urs B. brauchli at net-worker.ch
Tue Nov 18 10:51:28 CET 2014


Hi Forum

I have a multi-language/multi-domain site with shared content (using Typo3 v.4.7.17 and realurl).
Therein I have an extension, that creates links using getTypoLink_URL. This works fine so far - until I start to change the language.
I use the following code to create the links:

$cObj = t3lib_div::makeInstance('tslib_cObj');
$href = $cObj->getTypoLink_URL('256');

This produces something like /en/customers/contact/

Now, what happens is:

- first call, german -> works - link: /de/kunden/kontakt/
- change to english -> works - link: /en/customers/contact/
- change back to german -> doesn't work - link: customers/contact/

As you can see, when I change back to german, the language indicator is missing, as well as the leading slash.

Interestingly, I have a local installation (T3 v.4.5.x) of the same site where everything works fine. I tried to find the differences in the configuration but couldn't find any (besides the different T3 versions).

Any ideas???


More information about the TYPO3-english mailing list