Review main Merged

78170[BUGFIX] Avoid PHP 8 warnings when processing the INTinclude-scripts

Albrecht Köhnlein CR +2 V +2 Easy +48 −2 updated 03/21/23, 21:17

Commit message

Avoid PHP warnings when calling the method to process INTinclude
scripts when jsInline or jsFooterInline was set.

Previously, the jsInline and jsFooterInline was called after
$TSFE->INTincScript_loadJScode(), where TSFE considered
there were no *_INT objects, however, they were processed
later-on, thus no "divKey" was set and a PHP warning
was set.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Albrecht Köhnlein +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Albrecht Köhnlein +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2835

Show 710 earlier messages
  1. Albrecht Köhnlein uploaded patch set 1 03/19/23, 20:10

  2. Albrecht Köhnlein updated the commit message in patch set 2 03/19/23, 20:10

  3. Albrecht Köhnlein uploaded patch set 3 03/19/23, 20:13

  4. Albrecht Köhnlein uploaded patch set 4 03/19/23, 20:15

  5. Benni Mack commented on patch set 3 03/19/23, 20:16

    TypoScriptFrontendController.php:2203

    the if clause now prevents from replacing the marker, I'D rather suggest creating wrappers around the $this->additionalHeaderData (although it should always be an array) from above.
  6. Oliver Klee commented on patch set 2 CR -1 03/19/23, 20:17

    I think we also should have a regression test for this (as the current fix is incorrect, and I’d like to make sure that the fix solves the problem).
    On a grammatical level, this sentence does not make sense. Are there commas or words missing?

    TypoScriptFrontendController.php:2203

    These properties are arrays, and an empty array still evaluates as `true`. So the check needs to be !== [] for both properties.
  7. Oliver Klee commented on patch set 4 03/19/23, 20:18

    TypoScriptFrontendController.php:2203 Reply

    Or if it’s about the array no being null, we should use is_array checks.
  8. core-ci voted on patch set 2 V -1 03/19/23, 20:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39205

  9. core-ci voted on patch set 4 V +1 03/19/23, 20:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39207

  10. core-ci voted on patch set 1 V -1 03/19/23, 20:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39204

  1. Albrecht Köhnlein commented on patch set 4 03/19/23, 20:28

    Reply

    The warning currently only occurs for logged in frontend users. I have not yet figured out, what's different in the frontend rendering and caching process with logged in frontend user. Where exactly is the grammatical error in my text?
  2. Albrecht Köhnlein commented on patch set 4 03/19/23, 20:31

    TypoScriptFrontendController.php:2203 Reply

    I have changed the patch and now check if the problematic variable `$this->config['INTincScript_ext']['divKey']` is set. And not if there is content in additional header or footer data. I think this is a better idea.
  3. Albrecht Köhnlein commented on patch set 4 03/19/23, 20:32

    TypoScriptFrontendController.php:2203 Reply

    I have changed the patch and now check if the problematic variable `$this->config['INTincScript_ext']['divKey']` is set. And not if there is content in additional header or footer data
  4. Oliver Klee commented on patch set 4 03/19/23, 20:47

    Reply

    Maybe you mean this? (It's a guess, as I don't fully understand what you're trying to say.) Avoid PHP warnings when processing INTinclude scripts is triggered despite the variables being empty, which can happen for logged-in frontend users.

    TypoScriptFrontendController.php:2203 Reply

    Done
  5. Oliver Klee commented on patch set 4 03/19/23, 20:54

    Reply

    Also, I don't know which variables you are referring to with "the variables". Maybe you can elaborate on this a bit in the commit message. Also, the commit message does not make it clear whether this happens only/particularly if a FE user is logged in. ("when/if a FE user is logged in" is a wording I'd prefer as this is about a login session being present (I guess), and not about the users themselves.)
  6. core-ci voted on patch set 3 V -1 03/19/23, 21:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39206

  7. Albrecht Köhnlein updated the commit message in patch set 5 V +1 03/20/23, 09:57

  8. Albrecht Köhnlein commented on patch set 5 03/20/23, 09:59

    TypoScriptFrontendController.php:2203 Reply

    I investigated, how exactly to reproduce the warnings an updated the commit message now.
  9. core-ci voted on patch set 5 V +1 03/20/23, 10:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39227

  10. Oliver Klee updated the commit message in patch set 6 V +1 03/20/23, 10:38

  11. Oliver Klee commented on patch set 6 03/20/23, 10:38

    TypoScriptFrontendController.php:2203 Reply

    Done
  12. Oliver Klee commented on patch set 6 03/20/23, 10:38

    Reply

    Done
  13. Oliver Klee voted on patch set 6 CR +1 03/20/23, 10:39

  14. core-ci voted on patch set 6 V +1 03/20/23, 10:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39229

  15. Nikita Hovratov commented on patch set 6 V +1 CR +1 03/20/23, 17:36

    Looks OK from my side, but would be cool if someone with more knowledge about the rendering of INT objects would have a look here.
  16. Benni Mack commented on patch set 6 CR -2 03/20/23, 20:44

    sorry, there is an underlying other problem, which should be solved differently.
  17. Nikita Hovratov voted on patch set 6 V 0 CR 0 03/21/23, 08:19

  18. Benni Mack uploaded patch set 7 CR +1 V +1 03/21/23, 08:46

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR is:MIN")
  19. Benni Mack commented on patch set 7 V +1 CR +1 03/21/23, 08:46

    Sorry, but the fix was in the wrong place. I first added tests, and then moved the correct code in the right place.
  20. core-ci voted on patch set 7 V +1 03/21/23, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39301

  21. Oliver Klee voted on patch set 7 CR +1 03/21/23, 09:17

  22. Albrecht Köhnlein commented on patch set 7 V +1 CR +1 03/21/23, 19:12

    Thanks. Works fine in my scenario.
  23. Christian Kuhn voted on patch set 7 V +1 CR +1 03/21/23, 19:43

  24. Benni Mack voted on patch set 7 V +2 CR +2 03/21/23, 21:17

  25. Benni Mack merged patch set 8 03/21/23, 21:17