Review main Merged

69819[BUGFIX] Fix undefined array key warnings for frontend in PHP8

Jochen Roth CR +2 V +2 Hard +152 −143 updated 10/14/21, 06:38

Commit message

Add fallback for undefined array keys in EXT:frontend,
EXT:indexed_search, EXT:core.

This fixes frontend rendering of a basic site package
including all available content elements.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 19

Review log 2032

Show 47 earlier messages
  1. Jochen Roth uploaded patch set 1 07/12/21, 22:36

  2. core-ci voted on patch set 1 V +1 07/12/21, 22:47 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13266

  3. Jochen Roth uploaded patch set 2 07/13/21, 08:29

  4. core-ci voted on patch set 2 V +1 07/13/21, 08:43 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13273

  5. Jochen Roth uploaded patch set 3 07/13/21, 16:09

  6. core-ci voted on patch set 3 V -1 07/13/21, 16:22 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13299

  7. Jochen Roth uploaded patch set 4 07/13/21, 16:40

  1. core-ci voted on patch set 4 V -1 07/13/21, 16:52 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13302

  2. Jochen Roth uploaded patch set 5 07/13/21, 19:48

  3. core-ci voted on patch set 5 V +1 07/13/21, 20:00 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13303

  4. Jochen Roth uploaded patch set 6 07/13/21, 21:28

  5. core-ci voted on patch set 6 V +1 07/13/21, 21:41 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13304

  6. Jochen Roth uploaded patch set 7 07/13/21, 21:56

  7. core-ci voted on patch set 7 V -1 07/13/21, 22:19 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13306

  8. Jochen Roth uploaded patch set 8 07/14/21, 12:35

  9. core-ci voted on patch set 8 V +1 07/14/21, 12:51 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13317

  10. Jochen Roth uploaded patch set 9 07/14/21, 15:43

  11. core-ci voted on patch set 9 V +1 07/14/21, 15:58 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13322

  12. Oli Bartsch commented on patch set 9 07/14/21, 16:11

    ExtendedTemplateService.php:835

    Changes in this class are also done in https://review.typo3.org/c/Packages/TYPO3.CMS/+/69813

    ArrayFormFactory.php:57

    This should just be `$configuration['invalid'] ?? false`

    AbstractMenuContentObject.php:759

    $val['id'] is always set?

    AbstractMenuContentObject.php:1177

    Is this always set?

    AbstractMenuContentObject.php:1313

    Is this always set?

    TextMenuContentObject.php:76

    Looking at the usages shouldn't this be a string?

    RecordsContentObject.php:115

    Maybe we should also check this one in the if, otherwise we had to check this on every access.

    SearchController.php:951

    Not a fan of using `$lexer` here as its purpose is different, see line 954. Let's do it like in Indexer.php

    IndexSearchRepository.php:201

    This is a bool according to its annotation.

    Indexer.php:1097

    This is really hard to grasp. I would prefer not using short handed here.

    Indexer.php:1128

    Same as above

    Indexer.php:1798

    Only this one needs to be "secured"?

    Lexer.php:165

    When changing to strict types, I suggest to use a type cast for ($str[$pos] ?? '')

    Lexer.php:191

    Same as above

    Lexer.php:228

    Same as above
  13. Jochen Roth uploaded patch set 10 07/14/21, 19:34

  14. core-ci voted on patch set 10 V +1 07/14/21, 19:51 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13336

  15. Jochen Roth commented on patch set 10 07/15/21, 07:25

    ExtendedTemplateService.php:835 Reply

    Reverted the changes ExtendedTemplateService.php

    ArrayFormFactory.php:57 Reply

    Done

    AbstractMenuContentObject.php:759 Reply

    Yes :-)

    AbstractMenuContentObject.php:1177 Reply

    Set fallback here as well. Just in case.

    AbstractMenuContentObject.php:1313 Reply

    Yes.

    TextMenuContentObject.php:76 Reply

    Well, yes and no. $this->subMenu() expects int as first param while str_replace() expects string. Now casting $this->subMenu() to int.

    RecordsContentObject.php:115 Reply

    Done

    SearchController.php:951 Reply

    Done

    IndexSearchRepository.php:201 Reply

    Ack

    Indexer.php:1097 Reply

    Ack

    Indexer.php:1128 Reply

    Ack

    Indexer.php:1798 Reply

    "secured" the other 2 as well
  16. Oli Bartsch commented on patch set 10 07/15/21, 21:28

    TextMenuContentObject.php:76 Reply

    You're right. In that case I would suggest making it an int. Since you have to cast in one time anyway, uid<=>int makes more sense as fallback IMO. Sorry for the inconvenience.

    IndexSearchRepository.php:201 Reply

    Now it falls back to int, but it's still a bool. :)

    Lexer.php:165 Reply

    Done

    Lexer.php:191 Reply

    Still missing the string cast

    Lexer.php:228 Reply

    still missing the string cast
  17. Jochen Roth uploaded patch set 11 07/16/21, 08:44

  18. core-ci voted on patch set 11 V -1 07/16/21, 08:56 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13377

  19. Oli Bartsch rebased onto patch set 12 07/16/21, 12:37

  20. core-ci voted on patch set 12 V +1 07/16/21, 12:50 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13389

  21. Jochen Roth commented on patch set 12 07/16/21, 12:53

    TextMenuContentObject.php:76 Reply

    Done

    IndexSearchRepository.php:201 Reply

    Sorry, changed it.

    Lexer.php:191 Reply

    Done

    Lexer.php:228 Reply

    Done
  22. Oli Bartsch voted on patch set 12 V +1 CR +1 07/16/21, 12:54

  23. Benni Mack voted on patch set 12 V +2 CR +2 07/16/21, 15:26

  24. Benni Mack merged patch set 13 07/16/21, 15:26

  25. Benni Mack commented on patch set 13 10/14/21, 06:38

    Lexer.php:238

    $cType was not set anymore in this case. Fixed here https://review.typo3.org/c/Packages/TYPO3.CMS/+/71652