Review main Merged

62112[BUGFIX] Correctly check TSFE->rootLine

Markus Klein CR +2 V +2 Easy +1 −1 updated 10/30/19, 12:04

Commit message

The existing check on the data-type of $rootLine has to be adjusted
since the default value is now an array.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • TYPO3com +1 CI

Issues 2

Files 1

Review log 1114

  1. Markus Klein uploaded patch set 1 10/25/19, 12:56

  2. TYPO3com voted on patch set 1 V +1 10/25/19, 13:13 Completed build in 12m 09s on Fri, 25 Oct, 01:13 PM Test Summary: 48019 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37675

  3. Tymoteusz Motylewski voted on patch set 1 CR +1 10/25/19, 13:26

  4. Oli Bartsch commented on patch set 1 10/25/19, 13:38

    TypoScriptFrontendController.php:1694

    Would you mind making this check type-safe? $this->rootLine !== []
  5. Benni Mack commented on patch set 1 10/25/19, 14:24

    TypoScriptFrontendController.php:1694 Reply

    that's actually a regression from a previous fix, so I'd rather keep it like it is. I'll also provide some unit tess for that change.
  6. Oli Bartsch commented on patch set 1 10/25/19, 15:13

    TypoScriptFrontendController.php:1694 Reply

    Yes sure, I'm aware of the regression, which got introduced due to initializing the variable with an empty array. Thats why I thought about checking explicit for this - empty array - instead of using auto-magic functions.
  7. Georg Ringer voted on patch set 1 V +1 CR +1 10/29/19, 12:53

  8. Benni Mack commented on patch set 1 10/30/19, 11:09

    TypoScriptFrontendController.php:1694 Reply Unresolved

    just looked it up: unit tests won't work. if rootLine is empty, and getPageAndRootlineWithDomain is called, this is a fail already... So I question the usefulness of this method actually in the way it is. If you go with the strict typing check, people _could_ have misused this (basically looking at the regression we re-define the behaviour again - in a regression). Example of possible usages: before "empty string", "empty array", "array with properties" your proposal is: continue if its not an empty array. this would mean, it would continue if its an empty string. So basically, we should continue if is_array() and !empty()
  9. Benni Mack commented on patch set 2 10/30/19, 11:12

    Published edit on patch set 1.
  10. TYPO3com voted on patch set 2 V -1 10/30/19, 11:22 Completed build in 10m 34s on Wed, 30 Oct, 11:22 AM Test Summary: 47821 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37860

  11. TYPO3com voted on patch set 2 V +1 10/30/19, 11:27 Completed build in 26m 03s on Wed, 30 Oct, 11:27 AM Test Summary: 48071 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37860

  12. Georg Ringer voted on patch set 2 V +1 CR +1 10/30/19, 11:59

  13. Benni Mack voted on patch set 2 V +2 CR +2 10/30/19, 12:04

  14. Benni Mack merged patch set 3 10/30/19, 12:04