[TYPO3-dev] Bug? No language-merging for cType RECORDS - so also not for TV!?!

Franz Koch typo3 at fx-graefix.de
Sat Mar 4 20:39:50 CET 2006


Hi,

I think I just found a bug with 'sys_language_mergeIfNotBlank' but I 
must say I'm a little confused currently of the way it is handled.

When fetching content with cType CONTENT, the query for selecting the 
content elements is built by a function 'tslib_content::getWhere' which 
(and only if $conf['languageField'] is expicit defined) switches the 
language-selection in the where-clause from the current sys_language to 
'0,-1' (default,all languages) which means that you get the 
content-element in the default language back and not the originaly asked 
one.

This element is later (in cType CONTENT) passed to another if-clause 
that merges the actual current sys_language over the given one, which 
HAS TO BE either 'default' or 'all languages' (therefore it had been 
switched before).

Isn't that double-reverse-thing a little unhandy?

Well, I think it is, as in this way it is impossible to get 
language-merged content-elements that are not passed through the CONTENT 
cType, which would be for example cType RECORDS. Because cType RECORDS 
can have direct references to translated content-elements which aren't 
fetched over the before mentioned function 'tslib_content::getWhere' 
which reverses the language.

So you will most likely not get language-merged content-elements over 
the function call 't3lib_page::getRecordOverlay' in cType RECORDS which 
leads to a big problem with all TemplaVoila sites, that fecht almost 
every content over cType RECORDS.


I stumbled over this as I coulnd't get 'sys_language_mergeIfNotBlank' 
work in TemplaVoila but it has worked with common rendering (page.30 < 
styles.content.get).

I'm no core developer, so I don't know what the actual idea was behind 
this double-language-conversion whatever thing, but I think it would be 
much wiser to remove this language conversion stuff and handle the 
overlay in one central function, which would be 
't3lib_page::getRecordOverlay'.



The second thing is:
Currently the 'language conversion' in 'tslib_content::getWhere' is 
_ONLY_ done when the given $conf-Array contains a field called 
'languageField'. As I don't think that every developer is aware of this 
wouldn't it be better to simply check the TCA for the definition of that 
field (as it is done one line after: 6586, class.tslib_content.php) and 
optional check an override of the variable 'languageField'?


Did anybody understand what I'm talking about ;)

-- 
Kind regards,
Franz Koch




More information about the TYPO3-dev mailing list