Commit 9f131622 authored by Nicole Cordes's avatar Nicole Cordes Committed by Alexander Opitz
Browse files

[BUGFIX] Catch some FAL exceptions for missing driver

If a driver of a storage isn't available anymore (e.g. because an
extension was deactivated), an exception is thrown and the backend
stops working on multiple sites.

This patch catches the InvalidArgumentException which is thrown by the
DriverRegistry and ensures a proper working mode. The exception is
caught when:

- editing a record with inline record to a file of that storage
- editing a record with image manipulation of a file of that storage
- opening the element browser where the last folder was within that storage

Resolves: #71296
Releases: master
Change-Id: Ide83d411ab6c0e1850ff9cb9eec894753e73727f
Reviewed-on: https://review.typo3.org/44523

Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Alexander Opitz's avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz's avatarAlexander Opitz <opitz.alexander@googlemail.com>
parent 436d0e74
......@@ -351,7 +351,11 @@ class InlineRecordContainer extends AbstractContainer
$fileUid = array_pop(BackendUtility::splitTable_Uid($firstElement));
if (!empty($fileUid)) {
$fileObject = ResourceFactory::getInstance()->getFileObject($fileUid);
try {
$fileObject = ResourceFactory::getInstance()->getFileObject($fileUid);
} catch (\InvalidArgumentException $e) {
$fileObject = null;
}
if ($fileObject && $fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$thumbnail = $flashMessage->render();
......
......@@ -174,6 +174,7 @@ class ImageManipulationElement extends AbstractFormElement
try {
$file = ResourceFactory::getInstance()->getFileObject($fileUid);
} catch (FileDoesNotExistException $e) {
} catch (\InvalidArgumentException $e) {
}
}
return $file;
......
......@@ -135,6 +135,8 @@ class FileBrowser extends AbstractElementBrowser implements ElementBrowserInterf
$fileOrFolderObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->expandFolder);
} catch (Exception $accessException) {
// We're just catching the exception here, nothing to be done if folder does not exist or is not accessible.
} catch (\InvalidArgumentException $driverMissingExecption) {
// We're just catching the exception here, nothing to be done if the driver does not exist anymore.
}
if ($fileOrFolderObject instanceof Folder) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment