[BUGFIX] Unreadable directories must not crash filemount storages 96/35496/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 15 Dec 2014 19:26:13 +0000 (20:26 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Tue, 16 Dec 2014 12:58:22 +0000 (13:58 +0100)
If a *single* directory in the fileadmin tree can't be read, the whole
select box of the file mounts is empty.

Just hide the entry which is not readable

Resolves: #63915
Releases: master, 6.2
Change-Id: I96d5472bb284c259b986b88a766b0fa1e6dfca07
Reviewed-on: http://review.typo3.org/35496
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/core/Classes/Resource/Service/UserFileMountService.php

index 470424f..2d9f3a7 100644 (file)
@@ -115,7 +115,11 @@ class UserFileMountService {
                $allFolderItems = array($parentFolder);
                $subFolders = $parentFolder->getSubfolders();
                foreach ($subFolders as $subFolder) {
-                       $subFolderItems = $this->getSubfoldersForOptionList($subFolder, $level);
+                       try {
+                               $subFolderItems = $this->getSubfoldersForOptionList($subFolder, $level);
+                       }  catch(\TYPO3\CMS\Core\Resource\Exception\InsufficientFolderReadPermissionsException $e) {
+                               $subFolderItems  = array();
+                       }
                        $allFolderItems = array_merge($allFolderItems, $subFolderItems);
                }
                return $allFolderItems;