[TYPO3-dev] Selecting records and multilanguage

bernd wilke t3ng at pi-phi.tk
Mon Mar 22 17:44:58 CET 2010


On Mon, 22 Mar 2010 17:29:08 +0100 Rik Willems wrote:

> Hi all,
> 
> I am running into a little issue on which I'd like a little feedback. I
> created an extension that is fully multilanguage. Works like a charm.
> But now when I have a record that has sys_language_uid = -1 that record
> won't come up.
> 
> First I select the rows with (sys_language_uid = 0) and then I run it
> through getRecordOverlay(). Since the first query won't return the
> records with 'all languages' they are not run through getRecordOverlay()
> and won't show up. Now, when I do the first select with
> (sys_language_uid = 0 OR sys_language_uid = -1) it does work like I
> want. But, is this how it is supposed to be done? Looking forward to
> your feedback.

sys_language_uid <= 0 (is shorter than two conditions and 'OR')
and you get all records for your default language (=0) or any language 
(=-1)
your default-language is also 'any language'

with getRecordOverlay() you will get a 'translation' (language-version) 
of your primary record. As you have no record for your default-language 
(0) if only a record for all languages (-1) exists, you will get no 
'translation'.

bernd
-- 
http://www.pi-phi.de/cheatsheet.html




More information about the TYPO3-dev mailing list