[TYPO3-mvc] Query Matching and Multilanguage

Federico Bernardin typo3list at bernardin.it
Mon Oct 15 09:55:11 CEST 2012


Hi Matthias,
Are you sure that $GLOBALS['TSFE']->sys_language_uid is set according with correct language?
Extbase uses Querysettings function setRespectSysLanguage to define that record should be fetched according with sys_languge_uid. Then, if it's set, Extbase adds "tx_myextension_domain_model_whatever.sys_language_uid IN (' . $GLOBALS['TSFE']->sys_language_uid .',-1) ...".
Remember to check if you set $GLOBALS['TCA'][$tableName]['ctrl']['languageField'].

regards
Federico




Il giorno 13/ott/2012, alle ore 13:03, Matthias Krappitz <matthias at nospam.aemka.de> ha scritto:

> Hi,
> 
> Following Situation:
> - I do a simple custom query in my repository via the query objects as seen in the code below
> - I got records with multilanguage overlays and the title of one example record in the default language (German) is "Irgendetwas" and in the English language overylay it is "Something" .
> - The user then is in the english language version of the web-site in the frontend, executes the following query and is searching for "Something", wich then is in $value - but nothing gets found! But if I search for "Irgendetwas" I find my example record.
> 
> ...
> $query = $this->createQuery();
> return $query
>           ->matching(
>               $query->like('title', '%' . $value . '%')
>           )
>           ->execute();
> ...
> 
> I was expecting extbase would detect the frontend language and would also then be searching in the correct language overlay records, but it obviously does not, as the generated SQL of the above query contains "... tx_myextension_domain_model_whatever.sys_language_uid IN (0,-1) ...". So it only searches in the default language and in "any language"-records.
> 
> Is there anything I can do or configure about this behaviour to have it working truly multilanguage? How are you handling this?
> 
> Best Wishes
> 
> Matthias Krappitz
> w. www.aemka.de 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list