Review main Merged

88209[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors

Garvin Hicking CR +2 V +2 Easy +3 −0 updated 02/15/25, 08:49

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
    • Stefan Bürk +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 4

Files 1

Review log 56

  1. Garvin Hicking uploaded patch set 1 02/13/25, 19:41

  2. core-ci voted on patch set 1 V +1 02/13/25, 19:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74119

  3. Christian Kuhn voted on patch set 1 CR +1 V +1 02/14/25, 09:43

  4. Stefan Bürk voted on patch set 1 CR +1 V +1 02/14/25, 11:15

  5. Georg Ringer commented on patch set 1 CR +2 V +2 02/15/25, 08:49

    thanks! hat that issue as well in a 13 installation after update
  6. Georg Ringer merged patch set 2 02/15/25, 08:49