Review main Merged

52741[BUGFIX] Make extensionName parameter optional for LocalizationUtility::translate()

Xavier Perseguers CR +2 V +2 Easy +28 −2 updated 07/13/17, 20:57

Commit message

This patch prevents a PHP warning when second parameter of the method is not provided.
The extensionName is indeed optional since a fully qualified reference (starting with
"LLL:" may be provided as key.

Review

  • Code review CR +2
    • Markus Klein +2
    • Christian Kuhn +1
    • Henrik Elsner +1
  • Verified V +2
    • Markus Klein +2
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2328

Show 3 earlier messages
  1. Xavier Perseguers uploaded patch set 1 05/09/17, 10:35

  2. Oliver Klee commented on patch set 1 05/09/17, 10:38

    LocalizationUtility.php:81

    Do we have a unit test that calls the method with just one parameter?
  3. Xavier Perseguers commented on patch set 1 05/09/17, 10:40

    LocalizationUtility.php:81 Reply

    You guess it the same way as me I'd say, it would fail if this would be the case so your comment should instead read: "We should add a unit test for that case" :)
  1. TYPO3com voted on patch set 1 V +1 05/09/17, 10:41 Completed build in 05m 17s on Tue, 9 May, 12:41 PM Test Summary: 55794 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11287

  2. Xavier Perseguers uploaded patch set 2 05/09/17, 10:55

  3. Oliver Klee commented on patch set 2 05/09/17, 11:00

    LocalizationUtilityTest.php:459

    Why not test the actual translation here?
  4. TYPO3com voted on patch set 2 V +1 05/09/17, 11:03 Completed build in 07m 48s on Tue, 9 May, 01:03 PM Test Summary: 55800 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11292

  5. Xavier Perseguers commented on patch set 2 05/09/17, 11:05

    LocalizationUtilityTest.php:459 Reply

    If you have a look into the code, you'll see that it implies initializing a full blown $GLOBALS['LANG']. I'd love doing that but I really have to move back to fixing actual performance issues and not just PHP warnings :) This unit test will fail if parameter is not optional since warnings are turned into exceptions by our phpunit configuration. At least it really tests that optional parameter.
  6. Oliver Klee voted on patch set 2 CR +1 05/09/17, 11:19

  7. Benni Mack commented on patch set 2 05/10/17, 05:10

    LocalizationUtility.php:86

    shouldn't we then check on else if ($extensionName !== '') or we could even use null here instead of ''
  8. Elmar Hinz commented on patch set 2 05/11/17, 19:19

    LocalizationUtility.php:86 Reply

    If neither $key nor $extensionName provide the name, it would be a good place to throw an exception for this.
  9. Xavier Perseguers uploaded patch set 3 06/22/17, 15:09

  10. TYPO3com voted on patch set 3 V +1 06/22/17, 15:20 Completed build in 11m 12s on Thu, 22 Jun, 05:20 PM Test Summary: 56714 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-12785

  11. Oliver Klee commented on patch set 3 06/23/17, 08:20

    LocalizationUtility.php:75

    Then we also need the string|null type for the annotation here (and array|null for $arguments).
  12. Christian Kuhn commented on patch set 3 07/04/17, 21:36

    LocalizationUtilityTest.php:459

    a second patch could test if the exception is really thrown.
  13. Christian Kuhn commented on patch set 3 07/04/17, 22:04

    LocalizationUtility.php:88

    needs \ in front of class name.
  14. Christian Kuhn commented on patch set 3 07/04/17, 22:08

    LocalizationUtility.php:75 Reply

    Done

    LocalizationUtility.php:88 Reply

    Done

    LocalizationUtilityTest.php:459 Reply

    Done
  15. Christian Kuhn commented on patch set 3 07/04/17, 22:10

    imho no 7.6 backport anymore.
  16. Christian Kuhn uploaded patch set 4 07/04/17, 22:10

  17. Christian Kuhn uploaded patch set 5 07/04/17, 22:12

  18. TYPO3com voted on patch set 4 V +1 07/04/17, 22:21 Completed build in 10m 49s on Wed, 5 Jul, 12:21 AM Test Summary: 56775 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13007

  19. TYPO3com voted on patch set 5 V +1 07/04/17, 22:23 Completed build in 11m 05s on Wed, 5 Jul, 12:23 AM Test Summary: 56775 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13008

  20. Christian Kuhn voted on patch set 5 CR +1 V +1 07/04/17, 22:54

  21. Henrik Elsner voted on patch set 5 CR +1 07/06/17, 13:18

  22. Markus Klein voted on patch set 5 CR +2 V +2 07/06/17, 13:26

  23. Gerrit merged patch set 5 07/06/17, 13:26

  24. Markus Klein commented on patch set 6 07/06/17, 13:26

    Cherry Picked This patchset was cherry picked to branch TYPO3_8-7 as commit 4b9af9c88ede6e45272f50eb5371d2798c2e18eb
  25. Daniel Goerz commented on patch set 6 07/13/17, 20:57