Review 12.4 Merged

88226[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors

Georg Ringer CR +2 V +2 Easy +3 −0 updated 03/13/25, 08:43

Commit message

The patch in #106038 changed the initialisation of $this->selectedFolder
to be set to NULL by default, no longer trying to auto-guess the first
allowed storage.

This caused a followup problem when creating a new filemount and
trying to select an entrypoint, which opened the folder selector,
which utilized the IconForResourceViewHelper which requires a
resource object to be of type `ResourceInterface`, and not null
(failing with a PHP type error).

This patch adjusts the IconForResourceViewHelper to return
early without an icon (of a non-selected storage) in case
a NULL object is seen.

(Sidenote: The AbstractViewHelper does not [seem to] enforce
a registered argument with type `ResourceInterface::class`
to fail when it receives a NULL value)

Review

  • Code review CR +2 Done
    • Georg Ringer +2
  • Verified V +2 Done
    • Georg Ringer +2
    • Sven Juergens +1
    • core-ci +1 CI

Issues 4

Files 1

Review log 912

  1. Georg Ringer uploaded patch set 1 02/15/25, 08:53

  2. Georg Ringer abandoned the change 02/15/25, 08:54

  3. Georg Ringer restored the change 02/15/25, 08:55

  4. Georg Ringer uploaded patch set 2 02/15/25, 08:55

  5. Georg Ringer commented on patch set 2 02/15/25, 08:56

    This change is ready for review.
  6. core-ci voted on patch set 2 V +1 02/15/25, 09:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74174

  7. core-ci voted on patch set 1 V -1 02/15/25, 09:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74173

  8. Georg Ringer updated the commit message in patch set 3 V +1 02/15/25, 09:07

  9. core-ci voted on patch set 3 V +1 02/15/25, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74175

  10. Georg Ringer voted on patch set 3 CR +2 V +2 02/15/25, 09:21

  11. Georg Ringer merged patch set 4 02/15/25, 09:21

  12. Sven Juergens voted on patch set 4 V +1 03/13/25, 08:43