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

m+typo3-dev at qxio.tk m+typo3-dev at qxio.tk
Sat Jun 16 11:05:51 CEST 2018


Hello again,

here's an update for my issue:

I think I'm a step further. If I add ->setQueryLanguage(1) to the query
settings, doLanguageAndWorkspaceOverlay() tries to fetch the translated
record for language = 1. But in order to succeed I need to trick the
FrontendGroupRestriction class by setting $GLOBALS['TSFE']->gr_list =
"0,-2";.

The array returned by doLanguageAndWorkspaceOverlay() now contains all
translated entries, except the uid, which is still the uid from the
record in the main language. The uid of the translated record is stored
in _LOCALIZED_UID.

Now my problem now is that I still get the record in the main laguage
because DataMapper->mapSingleRow() (called via DataMapper->map()) has
some kind of object cache and thus returns the object in the default
language (because the uid is still the one of the record in the main
language).

All this seems a little hackish. So again my question: what is the
correct way to get a translated domain model in a CommandController?

thanks,
mika



More information about the TYPO3-dev mailing list