Review main Merged Breaking

32466[!!!][BUGFIX] Avoid to call stdWrap twice

Markus Klein CR +2 V +2 Normal +94 −2 updated 09/03/14, 10:34

Commit message

Using the recursive stdWrap will work on the stdWrap twice, although the
output is created only once.

Fix this by preventing the recursive call to stdWrap() if the
current function name is "stdWrap" as this will trigger a call to
stdWrap_stdWrap() later on anyway.

This will change rendering if LOAD_REGISTER or something similar
is used in a recursive stdWrap context.

Review

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

Issues 1

Files 3

Review log 25

  1. Markus Klein uploaded patch set 1 08/28/14, 00:11

  2. Frans Saris commented on patch set 1 08/28/14, 06:11

    Can we cover this with some tests?
  3. Stefan Froemken commented on patch set 1 CR +1 V +1 08/28/14, 06:38

    Very good. The first stdWrap does not make sense and was called with no content. So in my example it returns <b></b> instead of <b>Hello</b>. First with call to stdWrap_stdWrap the correct content will be generated. Sure: If you work with recursive stdWrap-Properties this will improve performance.
  4. Stefan Froemken commented on patch set 1 08/28/14, 06:48

    Is it possible to replace "code one the next level" with "code on the next level" in the comment on line 2074, too?
  5. Wouter Wolters voted on patch set 1 CR +1 08/28/14, 06:50

  6. Benni Mack voted on patch set 1 CR +2 08/28/14, 07:32

  7. Jo Hasenau voted on patch set 1 V +1 CR +1 08/28/14, 09:21

  8. Helmut Hummel commented on patch set 1 CR -1 08/28/14, 10:14

    Please add a test for that. We should also consider the impact. This has the potential to break existing TypoScript, which means this might only go into master, not into released versions
  9. Stefan Froemken uploaded patch set 2 08/28/14, 11:54

  10. Markus Klein commented on patch set 2 08/28/14, 14:13

    Thanks for the tests Stefan. @Helmut: I don't get your concern here, what would be breaking? Do have an example? (And I don't expect that anyone relied on this misbehaviour of executing things twice, since there was no output for the first call)

    ContentObjectRendererTest.php:1058

    Please change the name here. Describe what it should do and not what it should not do. There are by far more cases that should NOT happen, but only one case that SHOULD happen.

    ContentObjectRendererTest.php:1067

    Don't get this line here
  11. Stefan Froemken commented on patch set 2 08/28/14, 15:01

    ContentObjectRendererTest.php:1058 Reply

    Renaming is no problem. All the other things? Hmm. I will try. And if you are not happy with the new solution: It is fully OK if someone else will continue this work.

    ContentObjectRendererTest.php:1067 Reply

    I don't understand it, too. But it was set in line 2087. $functionName seems to be the property without dot. In my case "stdWrap". But there is no property called "stdWrap" in my snippet. That's why stdWrap was filled with NULL. So I have to expect the same in my tests too, to be green.
  12. Stefan Froemken uploaded patch set 3 08/28/14, 16:37

  13. Helmut Hummel commented on patch set 3 08/31/14, 15:48

    @Markus: There is a clear difference in rendering with particular TS. See for example: https://forge.typo3.org/issues/60135#note-7 If users relied on the (wrong) behavior, their TS will be broken after the patch! This is already mentioned by the OP in the bugreport … I'm not saying that this must not be fixed, I'm only a bit reluctant to include this in released branches. If we decide to merge this in 6.2 anyway, then this needs proper communication and at least a [!!!] in the commit message
  14. Helmut Hummel commented on patch set 3 CR -1 08/31/14, 15:52

    ContentObjectRendererTest.php:1058

    this test is unfortunately almost impossible to understand. Instead of excessive mocking, I'd rather use the TS from here: https://forge.typo3.org/issues/60135#note-7 to prove our expectations or register a userFuncFixture which counts calls in a static public property, so we can check that.
  15. Markus Klein commented on patch set 3 08/31/14, 16:53

    Thanks for the example, Helmut. I still consider this bug a case where integrators would have noticed that something is wrong and built a work-around. Hence they expect that this will be fixed some time. Still I'd like to see progress here, hence I'll change this to 6.3 only and add a [!!!]. Where do we document the breaking/correcting change?

    ContentObjectRendererTest.php:1058 Reply

    Please keep it simple and don't introduce userFunc hassle for this purpose. Let's take the counter example!
  16. Helmut Hummel uploaded patch set 4 09/01/14, 10:19

  17. Helmut Hummel commented on patch set 4 CR +1 V +1 09/01/14, 10:21

    For now I only kept 6.3 as target release. But if the release managers of 6.1 and 6.2 approve this to be backported, I would also be fine with that, too.
  18. Helmut Hummel voted on patch set 4 CR +2 09/01/14, 10:23

  19. Markus Klein commented on patch set 4 CR -1 09/01/14, 11:15

    Will push a fix, asap

    Breaking-60135-RecursiveStdWrapChange.rst:22

    Copy & Paste error?

    ContentObjectRendererTest.php:1042

    typo - Properly
  20. Markus Klein uploaded patch set 5 09/01/14, 11:55

  21. Helmut Hummel commented on patch set 4 09/01/14, 12:17

    Breaking-60135-RecursiveStdWrapChange.rst:22 Reply

    yes, sorry
  22. Helmut Hummel voted on patch set 5 CR +2 V +1 09/01/14, 12:18

  23. Stefan Froemken voted on patch set 5 CR +1 V +1 09/03/14, 07:40

  24. Markus Klein voted on patch set 5 V +2 09/03/14, 10:34

  25. Markus Klein merged patch set 5 09/03/14, 10:34