#105152503 when editor has no access to the default storage #2
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
- 12.4 88226[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors
- main 87946[BUGFIX] Update FAL error handling in element browser
- 13.4 88225[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors
- main 88209[BUGFIX] Harden IconForResourceViewHelper to prevent filemount errors
- 12.4 87962[BUGFIX] Update FAL error handling in element browser
- 13.4 87961[BUGFIX] Update FAL error handling in element browser
- 12.4 87957[BUGFIX] Update FAL error handling in link browser
- 13.4 87956[BUGFIX] Update FAL error handling in link browser
- main 87872[BUGFIX] Update FAL error handling in link browser
Related issues 4
- Bug #100959File storage 'fileadmin' as default storage must be allowed for editors to show other other filemounts in other file storages
- Bug #103897Reproducable 503 when editor has no access to the default storage
- Bug #106038Avoid exception in file element browser
- Bug #106173BUGFIX b1e36ce3dae (TYPO3 12.4.27) breaks entry point selection at Filemount