[BUGFIX] EXT:filelist Fixed exception when the base path does not exists 76/55476/5
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 28 Jan 2018 16:26:30 +0000 (17:26 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Fri, 9 Feb 2018 20:36:31 +0000 (21:36 +0100)
Resolves: #79785
Releases: master, 8.7
Change-Id: I50cf03273747b1fa32a1f8e4aac993a3fbc7b7f0
Reviewed-on: https://review.typo3.org/55476
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Timo Pfeffer <pfeffer.timo+typo3@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index def4d7e..ff3c1aa 100644 (file)
@@ -2844,13 +2844,22 @@ class ResourceStorage implements ResourceStorageInterface
                 } else {
                     if ($this->driver->folderExists($processingFolder) === false) {
                         $rootFolder = $this->getRootLevelFolder(false);
-                        $currentEvaluatePermissions = $this->evaluatePermissions;
-                        $this->evaluatePermissions = false;
-                        $this->processingFolder = $this->createFolder(
-                            $processingFolder,
-                            $rootFolder
-                        );
-                        $this->evaluatePermissions = $currentEvaluatePermissions;
+                        try {
+                            $currentEvaluatePermissions = $this->evaluatePermissions;
+                            $this->evaluatePermissions = false;
+                            $this->processingFolder = $this->createFolder(
+                                $processingFolder,
+                                $rootFolder
+                            );
+                            $this->evaluatePermissions = $currentEvaluatePermissions;
+                        } catch (\InvalidArgumentException $e) {
+                            $this->processingFolder = GeneralUtility::makeInstance(
+                                InaccessibleFolder::class,
+                                $this,
+                                $processingFolder,
+                                $processingFolder
+                            );
+                        }
                     } else {
                         $data = $this->driver->getFolderInfoByIdentifier($processingFolder);
                         $this->processingFolder = $this->getResourceFactoryInstance()->createFolderObject($this, $data['identifier'], $data['name']);