Review 13.4 Merged

88225[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors

Georg Ringer CR +2 V +2 Easy +3 −0 updated 02/15/25, 09:15

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
    • core-ci +1 CI

Issues 4

Files 1

Review log 34

  1. Georg Ringer commented on patch set 1 02/15/25, 08:49

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 02/15/25, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74172

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

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