[TYPO3-english] sys_language_uid, fallback on default language
Markus Klein
klein.t3 at mfc-linz.at
Wed Mar 14 16:35:34 CET 2012
Hi Muriel,
this time it was my fault.
I mixed code.
That's a whole working example.
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*',$table,'uid = ' . $uid);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
// language overlay
if ($GLOBALS['TSFE']->sys_language_contentOL) {
$OLmode = $GLOBALS['TSFE']->sys_language_contentOL;
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table, $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
I guess the JOIN is indeed a problem, especially if you need the translation from more than one table of the JOIN.
It's crucial to specify the correct $table for getRecordOverlay().
Unfortunately I don't have the time at the moment to help you any further. Consider looking into the source code of getRecordOverlay() to understand how it works.
Kind regards
Markus
> -----Original Message-----
> From: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] On Behalf Of Muriel le Pair
> Sent: Wednesday, March 14, 2012 3:04 PM
> To: typo3-english at lists.typo3.org
> Subject: Re: [TYPO3-english] sys_language_uid, fallback on default language
>
> Op 14-03-12 14:35, Markus Klein schreef:
> > Sorry, I forgot to mention that the first query has to fetch
> > sys_language_uid = TSFE->sys_language_content
>
> Hi Markus,
>
> I'm sorry I am really clueless here. I'm missing something.
>
> If I run the original query with
> sys_language_uid = '.$GLOBALS['TSFE']->sys_language_content
> and there are no records in that language then the array of $row will be empty and there is nothing to overlay.
>
> --
> kind regards,
>
> Muriel le Pair
>
>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list