Bug #60501
closedLocalization in CLI/BE mode
0%
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.
Updated by Alexander Opitz over 9 years ago
- Status changed from New to Needs Feedback
Which TYPO3 version are you using?
Updated by Alexander Opitz over 9 years ago
Ok, did you tried it with 6.2.5 already?
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.
Updated by Alexander Opitz over 9 years ago
Hi,
anything to report on this issue?
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
Updated by Viktor Livakivskyi about 9 years ago
Finally I was able to check it under TYPO3 6.2.9.
Verdict: still reproducable.
Updated by Alexander Opitz almost 9 years ago
- Status changed from Needs Feedback to New
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.
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.