Review main Merged

46702[TASK] Move moduleLabels to ModuleLoader

Benni Mack CR +2 V +2 Hard +372 −103 updated 10/07/16, 14:01

Commit message

Already translated module labels were previously resolved
and stored within $GLOBALS[LANG]. Several checks
and calls were then made to ModuleLoader and $LANG.

All information about the module, as well as all labels
are now stored within ModuleLoader, a addLabelsForModule()
method and a getLabelsForModule() method are placed within
that method, where labels are stored (but not resolved
to the language yet). The language service then is only used
when outputting the labels in various places.

The method $LANG->addModuleLabels() and the public
property $LANG->moduleLabels were deprecated.

Review

  • Code review CR +2
    • Andreas Wolf +2
    • Anja Leichsenring +1
    • Nicole Hummel +1
  • Verified V +2
    • Andreas Wolf +2
    • Anja Leichsenring +1
    • Nicole Hummel +1

Issues 1

Files 11

Review log 32

Show 7 earlier messages
  1. Benni Mack uploaded patch set 1 02/16/16, 10:56

  2. Benni Mack wrote 02/16/16, 11:00

    Patch set 2: Published edit on patch set 1.
  3. Mathias Schreiber wrote 02/16/16, 11:04

    Patch set 3: Published edit on patch set 2.
  4. Wouter Wolters commented on patch set 3 CR +1 02/16/16, 22:58

    Also checked TER for moduleLabels and although we have a few hits the extensions all look OLD
  5. Christian Kuhn commented on patch set 3 CR -1 02/19/16, 17:09

    LanguageService.php:61

    this is breaking, isn't it? with applied patch, this property is now always empty and it even doesn't throw a deprecation msg. shouldn't we better add a magic __get() to track acces to this property, throw deprecation and then return the former values?
  6. Benni Mack commented on patch set 3 02/23/16, 06:35

    yes. it's empty. There is no TER extension using LANG->moduleLabels compatible with v7 actually. (most of them are old skins from 4.1 times). So, we either remove the property completely (and mark the change as breaking) or always fill it as well (as before) and mark the access with a deprecation log with a magic getter method.
  7. Benni Mack commented on patch set 3 02/27/16, 20:21

    OK. I don't consider this relevant for marking it breaking, after thinking about it again. It is still possible to access moduleLabels() if one uses the deprecated method in his own e.g. backend bootstrap process, thus throwing deprecations and filling the array, but it isn't evaluated from the core anymore.
  1. Benni Mack uploaded patch set 4 03/04/16, 09:56

  2. Wouter Wolters voted on patch set 4 CR +1 03/04/16, 10:30

  3. Anja Leichsenring wrote 03/04/16, 10:41

    Patch set 5: Commit message was updated.
  4. Anja Leichsenring voted on patch set 5 CR +1 V +1 03/04/16, 10:47

  5. Christian Kuhn commented on patch set 5 03/04/16, 11:05

    reviewing
  6. Nicole Hummel commented on patch set 5 CR -1 03/04/16, 11:15

    ModuleLoader.php:400

    You test for isset() but using the key anyway?! Makes no sense to me
  7. Christian Kuhn commented on patch set 5 CR -1 03/04/16, 11:18

    ModuleLoader.php:369

    i think it would be useful to add unit tests to this method in combination with the "getter" method below to show which exact inputs this method can handle.

    ModuleLoader.php:400 Reply

    true. stumbled upon that, too.
  8. Christian Kuhn commented on patch set 5 V -1 03/04/16, 11:25

    -1 on testing: M=help_AboutAboutmodules #1351584844: An argument "key" or "id" has to be provided (More information) TYPO3Fluid\Fluid\Core\Exception thrown in file /var/www/t3master/cms-t3master/typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php in line 125.
  9. Nicole Hummel commented on patch set 5 03/04/16, 11:26

    ModuleLoader.php:369

    not psr-2 compatible

    ModuleLoader.php:410

    not psr-2 compatible
  10. Nicole Hummel commented on patch set 5 03/04/16, 11:29

    @christian: is there any third party extension installed for you? don't get any error in the module
  11. Benni Mack uploaded patch set 6 03/04/16, 17:46

  12. Benni Mack uploaded patch set 7 03/04/16, 17:50

  13. Nicole Hummel commented on patch set 7 03/04/16, 21:09

    ModuleLoaderTest.php:175

    I would move this to setUp() IHMO globals are backup and restored automatically. no need to care about that on your own.

    ModuleLoaderTest.php:179

    I would assert expectation and function call "on the fly". no need for an extra variable here.
  14. Mathias Schreiber commented on patch set 7 CR -2 03/05/16, 10:10

    fixing...
  15. Mathias Schreiber uploaded patch set 8 03/05/16, 11:35

  16. Mathias Schreiber voted on patch set 8 CR +1 V +1 03/05/16, 11:41

  17. Nicole Hummel commented on patch set 8 CR -1 03/05/16, 12:38

    Will push an update
  18. Nicole Hummel uploaded patch set 9 03/05/16, 12:59

  19. Nicole Hummel voted on patch set 9 CR +1 V +1 03/05/16, 12:59

  20. Anja Leichsenring voted on patch set 9 CR +1 V +1 03/05/16, 13:07

  21. Andreas Wolf voted on patch set 9 CR +2 V +2 03/05/16, 13:08

  22. Gerrit merged patch set 9 03/05/16, 13:08

  23. Frank Nägler commented on patch set 10 03/25/16, 10:49

    LanguageService.php:62

    post -1, this property is still in use by SetupModuleController::renderStartModuleSelect(). currently the dropdown field is broken. It looks like this change is not a deprecation but a breaking change.
  24. Frank Nägler commented on patch set 10 03/25/16, 11:36

  25. Nicole Hummel commented on patch set 10 10/07/16, 14:01

    ShortcutToolbarItem.php:290

    Due to the design of the function checkMod the result is always an array with at least two properties. So this condition is superfluous.