Review main Merged

80939[BUGFIX] Do not try to parse non-strings as XML in DataHandler

Oliver Klee CR +2 V +2 Easy +6 −6 updated 09/18/23, 16:26

Commit message

If the flexforms data is null, there is no point trying to parse
that as XML. This avoids type errors when `GeneralUtility` gets
native parameter type declarations for `GU::xml2array`, and it
should also slightly increase performance.

Also fix the corresponding PHPDoc type annotation to reflect
that a parameter in reality needs to be nullable.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1721

  1. Oliver Klee uploaded patch set 1 09/10/23, 12:07

  2. core-ci voted on patch set 1 V -1 09/10/23, 12:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46441

  3. Oliver Klee uploaded patch set 2 V -1 09/10/23, 12:31

  4. core-ci voted on patch set 2 V +1 09/10/23, 12:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46443

  5. Oliver Wand voted on patch set 2 CR +1 09/10/23, 15:44

  6. Georg Ringer commented on patch set 2 09/11/23, 06:39

    DataHandler.php:4118

    please change the variable name to $currentValue as it is not an array then
  7. Oliver Klee uploaded patch set 3 CR +1 V +1 09/11/23, 08:02

  8. Oliver Klee commented on patch set 2 09/11/23, 08:03

    DataHandler.php:4118 Reply

    Thanks, true true. :-) Done.
  9. core-ci voted on patch set 3 V +1 09/11/23, 08:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46463

  10. Stefan Bürk voted on patch set 3 V +1 CR +1 09/12/23, 05:25

  11. Georg Ringer commented on patch set 3 09/13/23, 05:15

    DataHandler.php:4093

    isn't null also a possible return value?
  12. Oliver Klee uploaded patch set 4 CR +1 V +1 09/13/23, 07:46

  13. Oliver Klee commented on patch set 3 09/13/23, 07:46

    DataHandler.php:4093 Reply

    Good catch - it is indeed! Done.
  14. core-ci voted on patch set 4 V +1 09/13/23, 07:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46532

  15. Georg Ringer voted on patch set 4 V +1 CR +1 09/13/23, 08:07

  16. Stefan Bürk commented on patch set 4 09/13/23, 08:27

    DataHandler.php:4093 Reply

    Why changing the return type adding another type to the soup - instead of using a empty '' as tenary fallback in https://review.typo3.org/c/Packages/TYPO3.CMS/+/80939/3/typo3/sysext/core/Classes/DataHandling/DataHandler.php#4118 ?
  17. Oliver Klee commented on patch set 4 09/13/23, 08:50

    DataHandler.php:4093 Reply

    I'm not changing the (actual) return type of the method (unless I'm missing something here). This method already returned `null` in some cases, and I'm fixing the return type annotation to match the actual behavior (both with and without this change). (I'd be fine with changing the (actual) return type, but that is out of scope of this change, which is about not calling `GU::xml2array` with `null` and hence avoiding a type error. If you think that we should change this method to never return `null`, could you create a (separate) ticket for that?)
  18. Christian Kuhn voted on patch set 4 V +1 CR +1 09/18/23, 14:25

  19. Stefan Bürk voted on patch set 4 V +1 CR +1 09/18/23, 15:01

  20. Stefan Bürk voted on patch set 4 V +2 CR +2 09/18/23, 15:10

  21. Stefan Bürk merged patch set 5 09/18/23, 16:26