[TYPO3-core] RFC #13647: Bug: mulitlanguage CONTENT.select on tablepages

JoH asenau info at cybercraft.de
Thu Feb 25 11:15:57 CET 2010


> This is an SVN patch request.
>
> Type: Bugfix

Sorry, but this is no bug - so this is a feature request.

> Bugtracker references:
> http://bugs.typo3.org/view.php?id=13647
>
> Branches:
> trunk
>
> Problem:
> If you make a select on the pages table within a CONTENT element it
> always reports the original pages content not the pages language
> overlay. If you use page tt_content instead it could make an lang
> overlay.
>
> Solution:
> The solution is a hack on tslib_cObj->CONTENT() which test for table
> pages and then use the getPageOverlay instead of getRecorrdOverlay

IMHO this is not even a solution but exactly what you named it: A hack.
So -1 for the current solution.

Some explanation:

tt_content never makes a "lang overlay" when selecting it with CONTENT and
languageField.
It just takes all content elements of certain page(s) defined in pidInList
that have the corresponding sys_language_uid.
This means:
If there is an original record and no translated element - you won't get
anything.
If there is no original record but an element in the other language - you
will get something.

A real overlay is something comepletely different, since it would fetch
translated elements based on languageField, l18n_parent and the uids of the
original records.
i.e.:

10 = CONTENT
10 {
    table = tt_content
    select {
        where = sys_language_id=0 AND colPos=0
    }
    renderObj = CONTENT
    renderObj {
        table = tt_content
        select {
            andWhere.dataWrap = sys_language_uid={TSFE:sys_language_uid} AND
l18n_parent={field:uid}
        }
        renderObj < tt_content
    }
}

Pages are treated different, since there is a real overlay table.
So if you want to get CONTENT with translated pages, you just have to make
sure to fetch stuff from the correct table:

10 = CONTENT
10 {
    table = pages_language_overlay
    select {
        andWhere.dataWrap = sys_language_uid={TSFE:sys_language_uid} AND pid
IN (1,2,3,4,5)
    }
    renderObj = COA
    renderObj {
        blah
    }
}

Of course it would make sense to implement this behaviour directly to the
first level of CONTENT for pages and other tables as well.
But this would be a new feature that IMHO should be triggered by a new
boolean switch:

i.e.

10 = CONTENT
10 {
    table = blah
    select {
        uidInList = 1,2,3,4,5
        where = sys_language_id=0
        getLanguageOverlay = 1
    }
}

or maybe a switch that contains the sys_language_uid to get the translation
from + stdWrap


10 = CONTENT
10 {
    table = blah
    select {
        uidInList = 1,2,3,4,5
        where = sys_language_id=0
        getLanguageOverlay.data = TSFE:sys_language_uid
    }
}

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com




More information about the TYPO3-team-core mailing list