Issue Bug Closed

#45873querySettings setRespectSysLanguage or setSysLanguageUid does not work

Dominic Garms 02/27/13, 01:29 updated 06/14/24, 20:49

Description

Hello,
currently its not possible to get a translated record after update from 4.7 to 6.0 or 6.1. This was working in 4.7:

$query = $this->createQuery();
$query->getQuerySettings()->setRespectSysLanguage(false);
$result = $query->matching(
  $query->logicalAnd($query->equals('sys_language_uid', $translatedLangUid), $query->equals('l10n_parent', $uidOfDefaultLang)))
    ->execute();
$myObject = $result->getFirst();

In 6.x its currently impossible to get the translated record with the data query, because the function in typo3DBbackend.php doLanguageAndWorkspaceOverlay() always overlays the record with the default language record.

If I try to set setSysLanguageUid($translatedLangUid) then I get the translated record but weirdly the UID gets overwritten with the default language UID and inside of the object I find _localizedUid and _languageUid. As I can’t reach this two attributes I have no idea how to correctly update or add the object into my repository.

As in 4.7 I could get this working I think it is a bug, or some major changes happens where I couldn’t find any information.

Regards,
Dominic

Reviews 4