[TYPO3-german] tt_news suchfunktion geht bei zweiter sprache nicht

Beate Sommer beate.sommer at macdev.de
Thu Feb 9 12:21:03 CET 2006


Hi,

ich habe deutsch als default und englisch als zweite Sprache definiert

Die Suche von tt_news findet problemlos Text in den deutschen beiträgen 
aber nichts in den englischen.

Ist das nur mein Problem oder können das andere nachvollziehen?

typo3 3.8.1
tt_news 2.2.24

Ich hab in der tt_news mailinglist das hier gefunden - weis aber nicht 
sicher ob es wirklich das gleiche Problem ist (sieht ganz so aus aber 
ich will das gerne vorher checken bevor ich am ende am falschen ende den 
schraubenschlüssel ansetzt - sprich vieleicht liegt es ja an meiner 
ts-config):


Hello,

I have a site in two languages using tt_news 2.2.24 (typo 3.8).

The search function will only return news when the keywords are present in
the original language (english). Note that it will return the translated
version  if the keywords are present in the default language news (which is
odd anyway) but a search in a language other then English will always give
empty results.
I've played with the 'sys_language_mode' setup and looked at the code 
but no
obvious answer there.
Any ideas?

Thank you,
Norbert

After going through the code, this is clearly a bug.
I have to modify the code to make this work.

Something like:

In the "getSelectConf" function of the class.tx_ttnews.php file, wrap the
"$selectConf" constructor in an if/else:

if ( $this->theCode == 'SEARCH' ) {
           if ( $GLOBALS['TSFE']->sys_language_content > -1 )
$selectConf['where'] .= ' AND tt_news.sys_language_uid =
'.$GLOBALS['TSFE']->sys_language_content;
}
else {
...
     //The already existing $selectConf constructor
     if....
    else...
...
}
if ($this->arcExclusive > 0) {  <--Already existing code
...
...

And at the start of the getListContent function:

while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {   <---- 
already
existing while loop

     //Revert to parent so we get all the otehrwise missing field
     if ( ( $this->theCode == 'SEARCH') && ( $row[l18n_parent] > 0 ) )  {
             //Get teh parent record instead now that the search was 
done on
the proper language record
             $where2parent = 'uid='.$row[l18n_parent].$this->enableFields;
             $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_news',
$where2parent);
             $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);
             $row = $row2;
     }

...
...


This modification would only return the search result of the current
language.



More information about the TYPO3-german mailing list