[TYPO3-mvc] resetting query settings for extbase cronjob

Domi djgarms at gmail.com
Fri Aug 2 08:53:39 CEST 2013


Hello,

I facing a very weird problem which happens in one of my cronjobs. 
Through a foreach I have multiple calls to a repository which doesn't 
work properly:

$query = $this->createQuery();
		$query->getQuerySettings()->setSysLanguageUid($languageUid);
if ($languageUid > 0) {
	$constraint = $query->equals('l10nParent', $mailTemplateUid);
} else {
	$constraint = $query->equals('uid', $mailTemplateUid);
}
$result = $query->matching(
	$constraint
)->execute()->toArray();

In my foreach the $languageUid is changing, but the record overlay stay 
the same from the first call. Example: $languageUid = 0, then all 
following records will get the default language. If the first call has 
$languageUid = 4, then all other calls will get the translated record.

Where do I need to search for the error? If I call the functions single 
to single, all works great, but in the loop only the first SysLanguage 
gets respected.

Does anyone know, if it is possible somehow to unset the 
$this-createQuery() ? Or what else could it be?

My debug shows all predicted behaviour, the sys_language is set correct 
and the variables all match, only the translated record is wrong.

Thanks for help,

Cheers,
Dominic


More information about the TYPO3-project-typo3v4mvc mailing list