[TYPO3-mvc] querySettings setRespectSysLanguage or setSysLanguageUid does further not work in 6.2?

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Tue May 6 08:29:12 CEST 2014


Hello typo3-world and extbase-junkies.

 

According to issue https://forge.typo3.org/issues/45873 I like to ask, how I
can fix this wrong behaviour.

I've two methods in my repository. The first one gets a list of objects and
works fine.

The second one gets a single object, if not translated I need the "english"
object, so I wrote this code:

 

/**

                * Returns a single hotel

                */

                public function findByUidNew($hotel){

                               $query = $this->createQuery();

 
$query->getQuerySettings()->setRespectStoragePage(FALSE);

                               if($GLOBALS['TSFE']->sys_language_uid != 0){

 
$query->getQuerySettings()->setRespectSysLanguage(FALSE);

 
$query->getQuerySettings()->setSysLanguageUid(1);

                                               $query = $query->matching(

 
$query->logicalAnd(

 
$query->equals('t3_origuid',$hotel),

 
$query->in('sys_language_uid',array(1))

                                                               )

                                               );

                               }else{

                                               $query = $query->matching(

 
$query->equals('uid',$hotel)

                                               );

                               }

                               return $query->execute()->getFirst(); 

                }

 

But everytime the "german" (L=0) object is rendered.
I tried using statements from
$query->getQuerySettings()->setLanguageMode('ignore') and
$query->getQuerySettings()->setLanguageOverlayMode(TRUE) - but nothing
helped.

 

How can I force  getting objects of specified language?

In detail: I've german objects, translated into english. On my french pages
the english objects shall appear. This is working for the list, but (I don't
know why!) not on the detail-page.

 

Kind regards

Johannes

 

 



More information about the TYPO3-project-typo3v4mvc mailing list