[TYPO3-english] Force sys_language_uid in Extbase query

Eric Chavaillaz eric at hemmer.ch
Tue May 12 16:33:09 CEST 2015


Hi list,

I have a query who perform over products.
Each product has for main language the German (sys_language_uid = 0) and 
are translated in French (1) and English (2).
The products are stored outside of the root websites (I have 3 websites 
who shared the products).

In 2 websites, the language configuration is like the products (0=de, 
1=fr and 2 = en), but the third is configured only in English (2).

So if I leave the default behavior of Extbase, it works fine for the 2 
first website. But for the third, I must force the language.
I have a query like :

$query=$this->createQuery();
$query->getQuerySettings()
    ->setRespectStoragePage(FALSE)
    ->setLanguageUid($languageUid);

$result=$query->matching(
	$query->equals('uid',$identifier)
    )->execute();

return$result->getFirst();

It works fine, my object is in English. But all my object storage 
(child) keep in German...
Any idea why?

Thanks a lot.

-- 
signature hemmer.ch
------------------------------------------------------------------------
	<http://www.hemmer.ch/>

	

Eric Chavaillaz
Directeur technique
Hemmer.ch SA
Intégrateurs web
Rue du Criblet 9
1700 Fribourg
Tél: +41 26 321 30 80
Fax: +41 26 321 30 82
eric at hemmer.ch <mailto:eric at hemmer.ch>
www.hemmer.ch
<http://www.hemmer.ch/> Présence au bureau: lundi, mardi, mercredi et jeudi




More information about the TYPO3-english mailing list