[BUGFIX] Prevent Exception when form folder doesn't exists 52/52352/2
authorFrans Saris <franssaris@gmail.com>
Tue, 4 Apr 2017 06:49:34 +0000 (08:49 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 4 Apr 2017 07:55:42 +0000 (09:55 +0200)
When for ext:form an addition allowedFileMounts is set to an
not existing folder you get an FolderDoesNotExistException when
opening the form editor.

This patch catches the FolderDoesNotExistException and ignores the
folder when not present.

Releases: master
Resolves: #80670
Change-Id: I40994cf0f7b7a005c0b902736c71dcb006b612dd
Reviewed-on: https://review.typo3.org/52352
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php

index da13293..9be408a 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Form\Mvc\Persistence;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter;
@@ -310,6 +311,8 @@ class FormPersistenceManager implements FormPersistenceManagerInterface
 
             try {
                 $folder = $storage->getFolder($fileMountIdentifier);
+            } catch (FolderDoesNotExistException $e) {
+                continue;
             } catch (InsufficientFolderAccessPermissionsException $e) {
                 continue;
             }