Project

General

Profile

Actions

Bug #60501

closed

Localization in CLI/BE mode

Added by Viktor Livakivskyi almost 10 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-07-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

There is a non-obvious and hacky behaviour, when developer tries to work with Extbase objects in CLI mode (and, probably, BE as well).

The problem is in fact, that using ->setSysLanguageUid($language) on query settings of Repository helps, but only for 1st level object. Child objects are non-localized in CLI mode.

Example:

$languageUid = 7;
// $parents contain correct translations (language=7)
$parents = $parentRepository->findAll($languageUid);
foreach($parents as $parent) {
// $child doesn't contain correct translation (language=0)
$child = $parent->getChild();
}

This can be "solved" in following way.

First you need to call GeneralUtility::_GETset($language, 'L') at the beginning of your action.
Next you need to initialize TypoScriptFrontendController object and set sys_language_mode to 'strict' (if needed), becasue it is used in Typo3DbBackend->doLanguageAndWorkspaceOverlay() method.

This is non-obviuos and hacky workaround.
I'd like Repositiries and PropertyMapper work same regardless from context it is called: FE, BE or CLI; and such settings, which affect the result of Repository and PropertyMapper mthods, as sys_language_mode should be shareable between the context or at least I need to be able to set them without need to initialize TypoScriptFrontendController.

Actions #1

Updated by Alexander Opitz over 9 years ago

  • Status changed from New to Needs Feedback

Which TYPO3 version are you using?

Actions #2

Updated by Viktor Livakivskyi over 9 years ago

Hi, Alexander.

This is TYPO3 6.1

Actions #3

Updated by Alexander Opitz over 9 years ago

Ok, did you tried it with 6.2.5 already?

Actions #4

Updated by Viktor Livakivskyi over 9 years ago

Not yet - going to try it out in next weeks. So, I'll give feedback about 6.2 as soon as possible.

Actions #5

Updated by Alexander Opitz over 9 years ago

Hi,

anything to report on this issue?

Actions #6

Updated by Alexander Opitz over 9 years ago

  • Project changed from 534 to TYPO3 Core
  • Category set to Extbase
  • TYPO3 Version set to 6.2
  • Is Regression set to No
Actions #7

Updated by Viktor Livakivskyi about 9 years ago

Finally I was able to check it under TYPO3 6.2.9.
Verdict: still reproducable.

Actions #8

Updated by Alexander Opitz almost 9 years ago

  • Status changed from Needs Feedback to New
Actions #9

Updated by Riccardo De Contardi about 5 years ago

  • Status changed from New to Needs Feedback

Hi and sorry for the late reply.

Is this issue still reproducible on TYPO3 9.5.x or the latest master? I guess that about localization, things has changed under the hood since 6.2 :)

Thank you and best regards.

Actions #10

Updated by Riccardo De Contardi almost 5 years ago

  • Status changed from Needs Feedback to Closed

This issue is very old, and I'm closing it for now.

Albeit localization still has problems in BE when using the described repositories, a fresh issue should be created and possibly an epic or story issue to collect all issues about detaching context-based differences from all repositories

Thank you and sorry for the late reply; if you think that this is the wrong decision,please reopen it or open a fresh issue with a reference to this one.

Actions

Also available in: Atom PDF