Review main Merged

87455[BUGFIX] Prevent undefined array key error core version checks

Oli Bartsch CR +2 V +2 Easy +15 −8 updated 12/12/24, 12:08

Commit message

In case the API response does not contain expected values,
this does no longer lead to an undefined array key errors.

Additonally, the version information is not shown, in
case no information are available.

Review

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

Issues 1

Files 3

Review log 1012

  1. Oli Bartsch uploaded patch set 1 12/11/24, 17:07

  2. core-ci voted on patch set 1 V +1 12/11/24, 17:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70964

  3. Benni Mack commented on patch set 1 CR +1 V +1 12/11/24, 23:33

    hard to "test" btw.
  4. Garvin Hicking commented on patch set 1 V -1 12/12/24, 08:40

    I've tested this by patching `typo3/sysext/install/Classes/Service/CoreVersionService.php`::`fetchFromRemove` to `return []` to provoke it in the legacy install UI. While this removes the exception, we may need to expose that on UI level, contacted Oli, just completing the note here.
  5. Oli Bartsch uploaded patch set 2 CR +1 V +1 12/12/24, 10:07

  6. Oli Bartsch commented on patch set 2 12/12/24, 10:10

    Reply

    As discussed, it's quite an effort to streamline the UI because there is currently no logic for "invalid API response" at all. This means on invalid API responses, the system assumes that the version is outdated and to distinguish this, we need to change quite an amount of code, which should IMO not be done in this patch since this will be backported to v12. I suggest to prevent the PHP errors and do UI changes in a separate patch.
  7. core-ci voted on patch set 2 V +1 12/12/24, 10:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71021

  8. Garvin Hicking commented on patch set 2 CR +1 V +1 12/12/24, 10:48

    Reply

    Yes, I was afraid the "UI route" would be much work, and agree. The edge cases where the API fails is hopefully rare enough.
  9. Benni Mack voted on patch set 2 CR +1 V +1 12/12/24, 11:03

  10. Christian Kuhn commented on patch set 2 12/12/24, 11:14

    CoreRelease.php:37

    just as note: "new \DateTimeImmutable('')" leads to "now".
  11. Oli Bartsch commented on patch set 2 CR +2 V +2 12/12/24, 12:08

    CoreRelease.php:37 Reply

    Sure, however before this would have been "NULL" which led to the same result, while NULL is deprecated.
  12. Oli Bartsch merged patch set 3 12/12/24, 12:08