Review main Merged

48288[BUGFIX] Fix output of DebugUtility

Helmut Hummel CR +2 V +2 Hard +216 −37 updated 05/29/16, 10:29

Commit message

This change prettifies the output of the debug output
methods, by using the Extbase DebuggerUtility for that purpose.

The benefits are consistent, well readable, properly encoded output
for every case the class provides.

In the long run, this class should be replaced with
a more object oriented approach.

Review

  • Code review CR +2
    • Helmut Hummel +2
    • Markus Klein +1
    • Nicole Hummel +1
  • Verified V +2
    • Helmut Hummel +2
    • Markus Klein +1
    • Nicole Hummel +1

Issues 1

Files 4

Review log 41

Show 16 earlier messages
  1. Helmut Hummel uploaded patch set 1 05/25/16, 17:36

  2. Markus Klein commented on patch set 1 05/25/16, 18:20

    DebugUtility.php:199

    call self::renderDump($array_in); directly
  3. Elmar Hinz commented on patch set 1 05/25/16, 18:48

    DebugUtility.php:40

    $debug doesn't seem to be used.
  4. Elmar Hinz commented on patch set 1 05/25/16, 18:55

    DebugUtility.php:40 Reply

    Found the usage. However it is rendered twice, what feels a little strange. Sure it is not critical for this.
  5. Wouter Wolters commented on patch set 1 CR -1 05/25/16, 20:50

    5 failing test here
  6. Helmut Hummel commented on patch set 1 05/25/16, 21:14

    DebugUtility.php:40 Reply

    What di you mean with twice? It is used HTML encoded once and not HTML encoded a second time
  7. Helmut Hummel uploaded patch set 2 05/25/16, 21:39

  8. Elmar Hinz commented on patch set 2 V -1 05/26/16, 06:48

    ContentObjectRendererTest.php is O.K. DebugUtility gives me mixed output in the context of a simple unit test. ``` stdClass prototype object b => stdClass prototype object c => stdClass prototype object<span class="extbase-debug-visibility">public</span><span class="extbase-debug-visibility">public</span> ```

    DebugUtility.php:40 Reply

    That's fine. No need to consider performance in this place.
  9. Helmut Hummel commented on patch set 1 05/26/16, 07:13

    @elmar: You are affected by a bug which is fixed here: https://review.typo3.org/#/c/48287
  10. Elmar Hinz commented on patch set 2 V 0 05/26/16, 07:19

    Yes, if I cherrypick both it doesn't happen.
  11. Elmar Hinz uploaded patch set 3 05/26/16, 08:36

  12. Elmar Hinz commented on patch set 3 V -1 05/26/16, 08:41

    I added some tests. They will only work if the patch for this Bug is applied: https://review.typo3.org/#/c/48287 Attention to the test debugInPopUpWindow(). This needs improvement. I think it currently indicates that there are command line shell escapes in the JavaScript message. For this reason -1 for verified.
  13. Elmar Hinz commented on patch set 3 05/26/16, 08:50

    For the test there is the issue, that the DebugUtilityl is context dependent especially dependent on constants. I guess setting constants requires to run phpunit with processIsolation="true". \TYPO3\CMS\Core\Tests\UnitTestCase is run with processIsolation="false". It may be better to make this a functional test for this reason.
  14. Elmar Hinz commented on patch set 3 05/26/16, 08:59

    The other tests don't return the "Header (Group)" of the debugInPopUpWindow().
  15. Nicole Hummel uploaded patch set 4 05/26/16, 10:49

  16. Nicole Hummel voted on patch set 4 CR +1 V +1 05/26/16, 10:49

  1. Wouter Wolters commented on patch set 4 05/26/16, 11:04

    DebugUtility.php:208

    renderDump directly
  2. Nicole Hummel uploaded patch set 5 05/26/16, 11:17

  3. Nicole Hummel voted on patch set 5 CR +1 V +1 05/26/16, 11:17

  4. Nicole Hummel commented on patch set 4 05/26/16, 11:17

    DebugUtility.php:208 Reply

    Done
  5. Elmar Hinz commented on patch set 5 05/26/16, 13:01

    DebugUtility.php:69

    Is it by intention that the header is not applied here? In case of multiple calls within cli one or two line breaks would be useful.

    DebugUtility.php:208

    Linebreak?
  6. Nicole Hummel commented on patch set 5 05/26/16, 13:06

    DebugUtility.php:69 Reply

    I guess the header isn't shown for a security reason in frontend. A debugging tool is not responsible to add any line breaks.

    DebugUtility.php:208 Reply

    A debugging tool is not responsible to add any line breaks.
  7. Elmar Hinz commented on patch set 5 05/26/16, 13:23

    DebugUtility.php:69 Reply

    Isn't it for CLI usage as well? "Directly echos out debug information as HTML (or plain in CLI context)" Isn't the responsibility of a debugging tool is to pretty print the variable contents? Doesn't that include the support of multiple calls? In the HTML output it does at least. :) Possibly it should already be handled by the Extbase DebuggerUtility.
  8. Elmar Hinz commented on patch set 5 V -1 05/26/16, 14:02

    CLI Test # Given ``` DebugUtility::debug([1, 2], 'Integers'); DebugUtility::debug(['one', 'two'], 'Strings'); ``` # Expected output: ``` Integers: 0 => 1 (integer) 1 => 2 (integer)array(2 items) Strings: 0 => "one" (3 chars) 1 => "two" (3 chars) ``` # Actual output: ``` 0 => 1 (integer) 1 => 2 (integer)array(2 items) 0 => "one" (3 chars) 1 => "two" (3 chars) ```
  9. Elmar Hinz commented on patch set 5 05/26/16, 14:05

    CLI Test (UPDATE) # Given ``` DebugUtility::debug([1, 2], 'Integers'); DebugUtility::debug(['one', 'two'], 'Strings'); ``` # Expected output: ``` Integers: array(2 items) 0 => 1 (integer) 1 => 2 (integer) Strings: array(2 items) 0 => "one" (3 chars) 1 => "two" (3 chars) ``` # Actual output: ``` array(2 items) 0 => 1 (integer) 1 => 2 (integer)array(2 items) 0 => "one" (3 chars) 1 => "two" (3 chars) ```
  10. Elmar Hinz commented on patch set 5 CR -1 05/26/16, 14:48

    DebugUtility.php:234

    Guess this bitwise & is a typo.
  11. Markus Klein commented on patch set 5 05/26/16, 22:58

    DebugUtility.php:234 Reply

    No, definitely not. Please see how TYPO3_REQUESTTYPE is defined.
  12. Elmar Hinz voted on patch set 5 CR +1 05/27/16, 04:26

  13. Helmut Hummel rebased onto patch set 6 05/28/16, 16:25

  14. Helmut Hummel uploaded patch set 7 05/28/16, 16:56

  15. Markus Klein voted on patch set 7 CR +1 05/28/16, 17:54

  16. Helmut Hummel uploaded patch set 8 05/28/16, 19:31

  17. Helmut Hummel uploaded patch set 9 05/28/16, 19:59

  18. Markus Klein voted on patch set 9 CR +1 05/28/16, 20:45

  19. Helmut Hummel uploaded patch set 10 05/28/16, 23:15

  20. Nicole Hummel voted on patch set 10 CR +1 V +1 05/29/16, 07:50

  21. Markus Klein uploaded patch set 11 05/29/16, 09:15

  22. Markus Klein voted on patch set 11 CR +1 V +1 05/29/16, 09:16

  23. Nicole Hummel commented on patch set 11 CR +1 V +1 05/29/16, 10:17

    Tested with FF, Chrome and IE11 on Windows 7
  24. Helmut Hummel voted on patch set 11 CR +2 V +2 05/29/16, 10:29

  25. Gerrit merged patch set 11 05/29/16, 10:29