Review main Merged

77887[BUGFIX] Fix PHP 8 warning in TypoLinkCodecService

Thomas Hohn CR +2 V +2 Easy +5 −4 updated 02/24/23, 15:41

Commit message

Added string cast before trimming $typoLink. Changed annotation
to be string|null. With TYPO3 v13 string should be added to the
methods signature and cast removed.
In addition fixed some potential calls that could have sent null
to the method, prophylactically.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Kevin Appelt +1
    • Kay Strobach +1
    • Marc Willmann +1
  • Verified V +2 Done
    • Benni Mack +2
    • Kevin Appelt +1
    • Kay Strobach +1
    • Marc Willmann +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2736

Show 911 earlier messages
  1. Thomas Hohn uploaded patch set 1 02/17/23, 12:57

  2. Oliver Klee commented on patch set 1 02/17/23, 13:02

    The way I read the code, I'd assume the problem lies in the caller (as the method already does not allow null according to the type annotation). So I'd recommend fixing the caller(s) instead.
  3. Georg Ringer voted on patch set 1 V +1 CR +1 02/17/23, 13:10

  4. Thomas Hohn uploaded patch set 2 CR +1 V +1 02/17/23, 13:21

  5. Thomas Hohn commented on patch set 1 02/17/23, 13:23

    Reply

    Found some potential places where null could be sent. Since it's only a type annotation and not part of the signature I would keep the trim
  6. core-ci voted on patch set 1 V -1 02/17/23, 13:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37831

  7. Thomas Hohn uploaded patch set 3 02/17/23, 13:35

  8. Oliver Klee wrote 02/17/23, 13:38

    Removed cc Oliver Klee.
  9. core-ci voted on patch set 2 V -1 02/17/23, 13:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37833

  10. Thomas Hohn wrote 02/17/23, 13:49

    Removed reviewer Georg Ringer.
  11. Thomas Hohn uploaded patch set 4 02/17/23, 13:53

  1. Andreas Kienast commented on patch set 3 CR -1 02/17/23, 13:56

    DataHandler.php:1963

    Can't we have an additional `is_string($value)` check instead of the null coalesce down below?
  2. core-ci voted on patch set 3 V -1 02/17/23, 13:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37834

  3. Stefan Bürk commented on patch set 4 02/17/23, 14:04

    DataHandler.php:1963 Reply

    That does not make any sense. L1949 calls trim() which always returns a string. Native type declaration of $value is non-nullable string. Thus $value is always a string and nothing else. THe null coalesce does not make sense either in this case. At least on v12. This must be done in v11 then if the circustances are there different.
  4. Thomas Hohn commented on patch set 4 02/17/23, 14:05

    DataHandler.php:1963 Reply

    Yes!
  5. Thomas Hohn uploaded patch set 5 02/17/23, 14:07

  6. core-ci voted on patch set 5 V +1 02/17/23, 14:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37840

  7. core-ci voted on patch set 4 V -1 02/17/23, 14:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37838

  8. Thomas Hohn uploaded patch set 6 V +1 02/17/23, 14:34

  9. core-ci voted on patch set 6 V -1 02/17/23, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37844

  10. Thomas Hohn updated the commit message in patch set 7 V -1 02/17/23, 15:49

  11. Thomas Hohn commented on patch set 7 02/17/23, 15:54

    Reply

    Done
  12. Thomas Hohn uploaded patch set 8 02/17/23, 16:30

  13. core-ci voted on patch set 7 V -1 02/17/23, 16:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37845

  14. core-ci voted on patch set 8 V +1 02/17/23, 16:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37847

  15. Thomas Hohn updated the commit message in patch set 9 V +1 02/17/23, 16:43

  16. core-ci voted on patch set 9 V +1 02/17/23, 16:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37848

  17. Kay Strobach commented on patch set 9 V +1 CR +1 02/24/23, 08:24

    Solved it for me. Thanks a lot.
  18. Benni Mack commented on patch set 9 02/24/23, 09:17

    TypolinkViewHelper.php:77

    pretty sure we need this change in Link/TypolinkViewHelper as well
  19. Thomas Hohn commented on patch set 9 02/24/23, 09:24

    TypolinkViewHelper.php:77 Reply

    Yes - will add it :-)
  20. Thomas Hohn commented on patch set 9 02/24/23, 09:30

    TypolinkViewHelper.php:77 Reply

    It's should be there already 😊
  21. Oliver Klee voted on patch set 9 CR +1 02/24/23, 09:59

  22. Kevin Appelt voted on patch set 9 V +1 CR +1 02/24/23, 11:06

  23. Marc Willmann commented on patch set 9 V +1 CR +1 02/24/23, 11:10

    Mitigates also the problem that CKEditor5 adds empty A Tags if configures as StylesSet (which breaks the frontend without this patch)
  24. Benni Mack voted on patch set 9 V +2 CR +2 02/24/23, 15:41

  25. Benni Mack merged patch set 10 02/24/23, 15:41