Issue Bug Closed

#106173BUGFIX b1e36ce3dae (TYPO3 12.4.27) breaks entry point selection at Filemount

Dirk Hoffmann 02/13/25, 17:12 updated 08/12/25, 14:36

Description

After updating from TYPO3 12.4.26 to TYPO3 12.4.27 we got a TypeError

TYPO3\CMS\Core\Imaging\IconFactory::getIconForResource(): Argument #1 ($resource) must be of type TYPO3\CMS\Core\Resource\ResourceInterface, null given, called in /Application/vendor/typo3/cms-core/Classes/ViewHelpers/IconForResourceViewHelper.php on line 72

It looks like the bugfix b1e36ce3dae, which was released with TYPO3 12.4.27, breaks the selection of the entry point for the filemount entry.
See: https://github.com/typo3/typo3/commit/b1e36ce3dae

This removed code in “TYPO3\CMS\Filelist\ElementBrowser\AbstractResourceBrowser->initSelectedFolder()” causes the problem:

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

Procedure for reproducing the issue:
- In Backend: Select the root page (ID 0) in list view
- Edit a filemount e.g. the default “fileadmin“
- Click on the ‘Search for folders’ button next to the ‘Entry point’ item.

Reviews 6