Review main Merged

52799[TASK] Use LanguageService inside TSFE

Benni Mack CR +2 V +2 Normal +106 −91 updated 10/16/17, 18:48

Commit message

TSFE does the same logic as $GLOBALS['LANG'] (= LanguageService) for
fetching labels and language files, but with a different language key.

However, LanguageService is not a singleton, so it _can_ be used
multiple times at the same request, so why not use the LanguageService
for labels based on config.sys_language, and the $GLOBALS['LANG'] record
based on the current backend user.

So, TSFE only acts as a wrapper for LanguageService instead of having
duplicate code.

A few now useless internal properties are dropped, some other
methods are deprecated:

- TSFE->LL_files_cache
- TSFE->LL_labels_cache

- TSFE->readLLfile()
- TSFE->getLLL()
- TSFE->initLLvars()

Review

  • Code review CR +2
    • Susi Moog +2
    • Wouter Wolters +1
    • Christian Kuhn +1
  • Verified V +2
    • Susi Moog +2
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 5

Review log 3039

Show 1014 earlier messages
  1. Benni Mack uploaded patch set 1 05/13/17, 14:36

  2. TYPO3com voted on patch set 1 V -1 05/13/17, 14:42 Completed build in 05m 27s on Sat, 13 May, 04:42 PM Test Summary: 12 of 55853 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11482

  3. Oliver Klee commented on patch set 1 05/13/17, 14:45

    I think there is a word missing at the end of the sentence.
  4. Georg Ringer commented on patch set 1 05/13/17, 16:50

    + rst missing but I guess you know that ;)

    TypoScriptFrontendController.php:4034

    should that method be depracated as well?

    TypoScriptFrontendController.php:4091

    php7 string $language.
  5. Elmar Hinz commented on patch set 1 05/13/17, 17:42

    LOL, no that's not the work of god, if there is everything in two similar variants, once for the frontend, once for the backend. It's an indicator of research to find the better variant. You do a great job to bring it into one solution after a decade. Having no control how often a cache is created is still a difficult design. Everybody calling GeneralUtility::makeInstance() will create a new cache. I hope we get the solution with a runtime cache in the end. To me it seem the solution most people can agree upon.
  6. Benni Mack commented on patch set 1 05/14/17, 12:30

    TypoScriptFrontendController.php:4034 Reply

    not possible yet, as it still used in other places. I will continue on that once we're pushing this topic further.
  7. Benni Mack uploaded patch set 2 05/14/17, 12:53

  8. TYPO3com voted on patch set 2 V -1 05/14/17, 12:58 Completed build in 05m 06s on Sun, 14 May, 02:58 PM Test Summary: 12 of 55853 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11489

  9. Andreas Kienast commented on patch set 2 05/14/17, 12:58

    TypoScriptFrontendController.php:4029

    No deprecation like "use LanguageService->sL() directly" here?
  10. Benni Mack commented on patch set 2 05/14/17, 13:37

    TypoScriptFrontendController.php:4029 Reply

    no. still used in many places like Extbase, we still need this (for now)
  11. Benni Mack uploaded patch set 3 05/14/17, 13:57

  12. TYPO3com voted on patch set 3 V -1 05/14/17, 14:02 Completed build in 05m 11s on Sun, 14 May, 04:02 PM Test Summary: 6 of 55853 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11490

  13. Benni Mack uploaded patch set 4 05/14/17, 19:27

  14. TYPO3com voted on patch set 4 V +1 05/14/17, 19:32 Completed build in 04m 52s on Sun, 14 May, 09:32 PM Test Summary: 55850 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11491

  1. Christian Kuhn commented on patch set 4 CR -1 05/18/17, 15:14

    some smaller remarks.
    some word is missing.

    Breaking-81217-TSFELabelRelatedCacheProperties.rst:12

    :php:`TypoScriptFrontendController`

    Deprecation-81217-TSFELabelRelatedMethods.rst:12

    :php:`TypoScriptFrontendController`

    TypoScriptFrontendController.php:2496

    shouldn't we better use ?? instead of ?: to suppress a possible e_notice here?
  2. Oliver Klee commented on patch set 4 05/18/17, 15:52

    To me, this looks more like a CLEANUP than the general TASK.
  3. Benni Mack commented on patch set 4 05/19/17, 05:22

    I'd say this isn't really cleanup, as it is a breaking change, not just cosmetical. Please also review the changed parts - I have a feeling that getLLL and getLL behave differently after that change, but would like more eyes on this.

    TypoScriptFrontendController.php:2496 Reply

    that's a difference. we should use !empty() I'd say. it could be set to empty, or not set at all. But ... empty value should not be allowed either... hmm
  4. Frank Nägler commented on patch set 4 05/19/17, 20:23

    TypoScriptFrontendController.php:2496 Reply

    for an empty value this work, but in case it is not set, we get a notice. I think also we should use ?? instead of ?:
  5. Benni Mack commented on patch set 5 05/20/17, 11:32

    Published edit on patch set 4.
  6. TYPO3com voted on patch set 5 V +1 05/20/17, 11:38 Completed build in 05m 19s on Sat, 20 May, 01:38 PM Test Summary: 55886 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11610

  7. Georg Ringer voted on patch set 5 CR +1 V +1 06/13/17, 12:36

  8. Benni Mack uploaded patch set 6 06/16/17, 10:25

  9. TYPO3com voted on patch set 6 V +1 06/16/17, 10:41 Completed build in 16m 14s on Fri, 16 Jun, 12:41 PM Test Summary: 56514 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-12621

  10. Stefan Neufeind commented on patch set 6 06/17/17, 13:19

    TypoScriptFrontendController.php:4072

    Let's just call it v10 instead of v10.0 maybe?

    TypoScriptFrontendController.php:4101

    typo: setOutputLanguage but setOutputLanguage is also protected! I guess you meant settingLanguage()?
  11. Stefan Neufeind uploaded patch set 7 09/07/17, 08:07

  12. Stefan Neufeind commented on patch set 6 09/07/17, 08:07

    rebased
  13. TYPO3com voted on patch set 7 V -1 09/07/17, 08:26 Completed build in 19m 25s on Thu, 7 Sep, 10:26 AM Test Summary: 1 of 58496 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-14277

  14. TYPO3com voted on patch set 7 V +1 09/09/17, 11:15 Completed build in 3h 28m 02s on Sat, 9 Sep, 01:15 PM Test Summary: 58133 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-14277

  15. Stefan Neufeind voted on patch set 7 CR +1 09/09/17, 17:26

  16. Andreas Kienast commented on patch set 7 09/10/17, 08:24

    TypoScriptFrontendController.php:4114

    as setOutputLanguage is protected, I'd remove that hint
  17. Markus Hölzle commented on patch set 7 09/10/17, 09:26

    Does the typoscript option "config.language_alt" from the documentation works with this? https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#language-alt
  18. Benni Mack commented on patch set 7 09/10/17, 11:11

    no, not currently (it's only available currently in PiBased Plugins, Extbase TranslationService and EXT:form - so no change of behaviour.
  19. Benni Mack uploaded patch set 8 10/16/17, 17:12

  20. TYPO3com voted on patch set 8 V +1 10/16/17, 17:22 Completed build in 10m 36s on Mon, 16 Oct, 07:22 PM Test Summary: 56612 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15692

  21. Christian Kuhn voted on patch set 8 CR +1 V +1 10/16/17, 18:27

  22. Wouter Wolters voted on patch set 8 CR +1 10/16/17, 18:44

  23. Susi Moog voted on patch set 8 CR +1 10/16/17, 18:47

  24. Susi Moog voted on patch set 8 CR +2 V +2 10/16/17, 18:48

  25. Gerrit merged patch set 8 10/16/17, 18:48