[TYPO3-dev] Correct usage of translated records in CLI

Mika m+typo3-dev at qxio.tk
Wed Jun 13 22:40:13 CEST 2018


Dear all,

I've searched and debugged the last couple of days how to obtain the
translated version of a DomainModel in a CommandController in Typo3 v8.7.

In Typo3 4.5/4.7 I've done the following:
- input: DomainModel in default language
- build a query that finds the record with the l10n_parent matching the
  given domain model
- obtain a new domain model with the desired sys_language_uid

Unfortunately this does not work in Typo3 v8.7 any more. I always get
the domain model for the default language.

I've traced this down to the method
'Typo3DbBackend::doLanguageAndWorkspaceOverlay' called via
'Typo3DbBackend::getObjectDataByQuery'.

The query returns the correct (translated) row, but then the variable
$row gets overwritten in doLanguageAndWorkspaceOverlay no matter how I
set the querySettings 'setLanguageOverlayMode' and 'setLanguageMode'.

So what is the correct way to get a translated domain model in a
CommandController?

thanks for your help,
mika



More information about the TYPO3-dev mailing list