Review main Merged

54558[BUGFIX] Fix some PHP Notices thrown when rendering page module

Tymoteusz Motylewski CR +2 V +2 Normal +65 −43 updated 11/16/17, 07:28

Commit message

Review

  • Code review CR +2
    • Susi Moog +2
    • Wouter Wolters +1
    • Frans Saris +1
  • Verified V +2
    • Susi Moog +2
    • Frans Saris +1
    • TYPO3com +1 CI

Issues 1

Files 13

Review log 2129

Show 34 earlier messages
  1. Tymoteusz Motylewski uploaded patch set 1 11/04/17, 23:28

  2. Tymoteusz Motylewski commented on patch set 1 11/04/17, 23:36

    this patch together with https://review.typo3.org/54557 reduced the number of notices in page module rendering from 3500 to 400. It can be improved much more easily, if we agree how to handle hooks (whether to test isset + is_array, or just !empty
  3. TYPO3com voted on patch set 1 V -1 11/04/17, 23:37 Completed build in 09m 10s on Sun, 5 Nov, 12:37 AM Test Summary: 10 of 57109 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16082

  4. Frans Saris commented on patch set 1 11/04/17, 23:44

    PageLayoutController.php:990

    Why not just replace it with empty()?

    PageLayoutController.php:998

    same here

    ModuleLoader.php:177

    use !empty() here?
  1. Tymoteusz Motylewski commented on patch set 1 11/04/17, 23:46

    PageLayoutController.php:990 Reply

    I wanted to be non breaking in case somebody set disableAdvanced = 0
  2. Tymoteusz Motylewski commented on patch set 1 11/05/17, 00:02

    PageLayoutController.php:990 Reply

    you're right, empty should also work
  3. Tymoteusz Motylewski uploaded patch set 2 11/05/17, 18:32

  4. TYPO3com voted on patch set 2 V -1 11/05/17, 18:41 Completed build in 08m 20s on Sun, 5 Nov, 07:41 PM Test Summary: 10 of 57109 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16097

  5. Tymoteusz Motylewski uploaded patch set 3 11/05/17, 18:50

  6. TYPO3com voted on patch set 3 V +1 11/05/17, 18:59 Completed build in 08m 58s on Sun, 5 Nov, 07:59 PM Test Summary: 56750 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16098

  7. Frans Saris commented on patch set 3 11/05/17, 19:40

    ModuleLoader.php:164

    use !empty() or add () around this as it changes behavior this way :)

    BackendUtility.php:1761

    add !empty() here to?

    PageLayoutView.php:1962

    should this be ?: as ?? only checks for null of not set.

    LogManager.php:182

    this changes behaviour. because if $configuration[$configurationKey] was false or '' this wouldn't result in a empty array anymore

    DatabaseSessionBackend.php:54

    (bool)$configuration['has_anonymous'] ?? false;

    ExtensionManagementUtility.php:905

    same here. if value is false or '' then this gives different results

    ExtensionUtility.php:62

    use empty() as isset(false) gives true

    ExtensionUtility.php:198

    same here

    tt_content.php:6

    empty()

    tt_content.php:9

    empty

    tt_content.php:12

    empty
  8. Tymoteusz Motylewski commented on patch set 3 11/05/17, 22:16

    ModuleLoader.php:164 Reply

    && has precedence over || so no need for () around

    PageLayoutView.php:1962 Reply

    $row['_ORIG_uid'] is not always set -> this is why a notice is thrown. So ?: is not an option.

    LogManager.php:182 Reply

    I think it's ok, as neither false nor "" is a correct configuration. See https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Logging/Configuration/Index.html

    DatabaseSessionBackend.php:54 Reply

    your proposal would still throw a notice
  9. Frans Saris commented on patch set 3 11/06/17, 07:35

    ModuleLoader.php:164 Reply

    ah, you are right. But using !empty() instead of isset() && ... would make this easier to read right? And would do the same

    PageLayoutView.php:1962 Reply

    true. But are you sure $row['_ORIG_uid'] can never be 0?

    LogManager.php:182 Reply

    ok

    DatabaseSessionBackend.php:54 Reply

    you are right, should be: = (bool)($configuration['has_anonymous'] ?? false);
  10. Tymoteusz Motylewski commented on patch set 3 11/06/17, 07:54

    ExtensionUtility.php:62 Reply

    I've used isset to avoid overriding the configuration on each call, but as this method is called with different settings each time, I can change it to empty.

    ExtensionUtility.php:198 Reply

    Done

    tt_content.php:6 Reply

    can do, but is looks a little bit odd if (empty) set empty :)
  11. Tymoteusz Motylewski uploaded patch set 4 11/06/17, 08:12

  12. TYPO3com voted on patch set 4 V +1 11/06/17, 08:21 Completed build in 08m 56s on Mon, 6 Nov, 09:21 AM Test Summary: 56750 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16101

  13. Tymoteusz Motylewski uploaded patch set 5 11/14/17, 14:24

  14. TYPO3com voted on patch set 5 V +1 11/14/17, 14:33 Completed build in 09m 43s on Tue, 14 Nov, 03:33 PM Test Summary: 56768 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16335

  15. Tymoteusz Motylewski uploaded patch set 6 11/14/17, 14:46

  16. Tymoteusz Motylewski uploaded patch set 7 11/14/17, 14:46

  17. Tymoteusz Motylewski uploaded patch set 8 11/14/17, 14:54

  18. TYPO3com voted on patch set 6 V -1 11/14/17, 14:57 Completed build in 10m 55s on Tue, 14 Nov, 03:57 PM Test Summary: 2 of 57127 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16337

  19. TYPO3com voted on patch set 7 V +1 11/14/17, 14:59 Completed build in 12m 04s on Tue, 14 Nov, 03:59 PM Test Summary: 56768 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16338

  20. TYPO3com voted on patch set 8 V +1 11/14/17, 15:04 Completed build in 10m 13s on Tue, 14 Nov, 04:04 PM Test Summary: 56768 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-16339

  21. Frans Saris voted on patch set 8 CR +1 11/14/17, 17:33

  22. Frans Saris voted on patch set 8 V +1 11/14/17, 17:34

  23. Wouter Wolters voted on patch set 8 CR +1 11/14/17, 18:28

  24. Susi Moog voted on patch set 8 CR +2 V +2 11/16/17, 07:28

  25. Gerrit merged patch set 8 11/16/17, 07:28