Issue Bug Closed

#105152503 when editor has no access to the default storage #2

Wolfgang Klinger 09/27/24, 11:22 updated 12/02/25, 14:32

Description

The bug (tried) to fix here: https://forge.typo3.org/issues/103897
is still an open bug here: typo3/cms-filelist/Classes/LinkHandler/AbstractResourceLinkHandler.php:198
where the same condition is used.

        if (!$this->selectedFolder) {
            $this->selectedFolder = $this->resourceFactory->getDefaultStorage()?->getRootLevelFolder() ?? null;
        }

How to reproduce:
- Create a text element
- Add some text
- Link the text
- Select “File” in the opening dialog
- Booomm

Solution is the same as in the already published fix:

        if (!$this->selectedFolder) {
            $allStorages = $this->getBackendUser()->getFileStorages();
            $defaultStorage = $this->resourceFactory->getDefaultStorage();
            if ($defaultStorage && array_key_exists($defaultStorage->getUid(), $allStorages)) {
                $this->selectedFolder = $defaultStorage->getRootLevelFolder();
            } else {
                $this->selectedFolder = reset($allStorages)->getRootLevelFolder();
            }
        }

Reviews 9

History 818

  1. Dennis Grün commented <span data-processor="relativetime" data-value="2024-11-04T10:20:13+00:00" > 11/04/24, 10:20 </span>

    Can confirm, editors without access to default storage opening link browser in file mode just throws exception 1375955684.

  2. Tobias Wollender commented <span data-processor="relativetime" data-value="2025-01-10T21:58:42+00:00" > 01/10/25, 21:58 </span>

    We also had this problem today (with TYPO3 12.4.24). Thanks for the proposed fix, which worked as described.

  3. Fabian Schiller commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-01-31T12:25:13+00:00" > 01/31/25, 12:25 </span>

    Applied in changeset commit:533a0f8b6e5d139d63e455f09f57486c53a20860.