Bug #46785
closedFileDoesNotExistException
Added by Vincent Mans over 11 years ago. Updated about 7 years ago.
100%
Description
Frontend form with image upload to tt_news record. If the image is not found (because of external reasons) the page with (in this case) uid=15 shows "Oops, an error occurred!" in the backend.
Obviously, we must take care that the path is correct.
But the point is: an editor should be able to open the page and edit the tt_news record, if such things happen. So this exception should be handled differently.
(TYPO3 v 6.0.4)
Extension: Core: Exception handler (WEB)
Severity: 4
Uncaught TYPO3 Exception: | TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException thrown in file /home/sites/clients/client4/web48/web/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php in line 399. Requested URL: http://test.domain.tld/typo3/mod.php?M=web_list&id=15
Updated by Rastislav Birka over 11 years ago
same problem is in RTE in standard text CE, if there is link to file which doesn't exist is not possible edit this CE in BE because shows error "Oops, an error occurred!"
Updated by Markus Blaschke over 11 years ago
All TCA-based tables and also flexforms will crash with a FileDoesNotExistException if one of the files is missing.
Should be a BLOCKER here because an admin have to fix the relations manually in database, no editor can fix this.
Updated by Franz Holzinger over 11 years ago
I have a FE user franzholz, from whom the image file is 'Reisepass-kl.jpg'.
However this is not found.
Why does it try to read this file "uploads/pics/franzholz_Reisepass-kl_497dbf6406.jpg"?
This is stored in the image field of the fe_users Table:
franzholz_Reisepass-kl_497dbf6406.jpg,Reisepass-kl.jpg,franzholz_img_8667_skl_d695bde941.jpg
I do not know, where the name 'franzholz_Reisepass-kl_497dbf6406.jpg' comes from. Maybe the install tool has added this?
--------------------------------------------------
Uncaught TYPO3 Exception TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException thrown in file /var/www/path/web/typo3_src-6.0.4/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php in line 399. 11 TYPO3\CMS\Core\Resource\Driver\AbstractDriver::getFile("uploads/pics/franzholz_Reisepass-kl_497dbf6406.jpg") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/core/Classes/Resource/ResourceStorage.php: 00798: */ 00799: public function getFile($identifier) { 00800: return $this->driver->getFile($identifier); 00801: } 00802: 10 TYPO3\CMS\Core\Resource\ResourceStorage::getFile("uploads/pics/franzholz_Reisepass-kl_497dbf6406.jpg") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/core/Classes/Resource/ResourceFactory.php: 00285: $fileIdentifier = $parts[0]; 00286: } 00287: return $this->getStorageObject($storageUid)->getFile($fileIdentifier); 00288: } 00289: 9 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectFromCombinedIdentifier("uploads/pics/franzholz_Reisepass-kl_497dbf6406.jpg") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/core/Classes/Resource/ResourceFactory.php: 00328: } else { 00329: // only the path 00330: return $this->getFileObjectFromCombinedIdentifier($input); 00331: } 00332: } 8 TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject("uploads/pics/franzholz_Reisepass-kl_497dbf6406.jpg") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/backend/Classes/Utility/BackendUtility.php: 01519: if ($theFile) { 01520: $fileName = trim($uploaddir . '/' . $theFile, '/'); 01521: $fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($fileName); 01522: $fileExtension = $fileObject->getExtension(); 01523: if ($fileExtension == 'ttf' || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileExtension)) { 7 TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode(array, "fe_users", "image", "") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php: 00530: */ 00531: public function thumbCode($row, $table, $field) { 00532: return \TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode($row, $table, $field, $this->backPath); 00533: } 00534: 6 TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList::thumbCode(array, "fe_users", "image") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php: 00651: // Render thumbsnails if a thumbnail column exists and there is content in it: 00652: if ($this->thumbs && trim($row[$thumbsCol])) { 00653: $theData[$fCol] .= ' ' . $this->thumbCode($row, $table, $thumbsCol); 00654: } 00655: $localizationMarkerClass = ''; 5 TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::renderListRow("fe_users", array, 4, "username", "image") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php: 00496: $cc++; 00497: $this->translations = FALSE; 00498: $iOut .= $this->renderListRow($table, $row, $cc, $titleCol, $thumbsCol); 00499: // If localization view is enabled it means that the selected records are 00500: // either default or All language and here we will not select translations 4 TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::getTable("fe_users", 0, "") /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php: 00433: } 00434: // Finally, render the list: 00435: $this->HTMLcode .= $this->getTable($tableName, $this->id, implode(',', $fields)); 00436: } 00437: } 3 TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList::generateList() /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/Classes/RecordList.php: 00312: } 00313: // Render the list of tables: 00314: $dblist->generateList(); 00315: // Write the bottom of the page: 00316: $dblist->writeBottom(); 2 TYPO3\CMS\Recordlist\RecordList::main() /var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/mod1/index.php: 00056: } 00057: $SOBE->clearCache(); 00058: $SOBE->main(); 00059: $SOBE->printContent(); 00060: ?> 1 require("/var/www/path/web/typo3_src-6.0.4/typo3/sysext/recordlist/mod1/index.php") /var/www/path/web/typo3_src-6.0.4/typo3/mod.php: 00039: require $temp_path . 'conf.php'; 00040: $BACK_PATH = ''; 00041: require $temp_path . 'index.php'; 00042: $isDispatched = TRUE; 00043: } else {
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Accepted
- Target version set to 6.0.5
Verified with 6.2-dev trunk
Updated by Gerrit Code Review over 11 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20570
Updated by Alexander Opitz over 11 years ago
- Target version changed from 6.0.5 to 6.2.0
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20570
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20570
Updated by Gerrit Code Review over 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20570
Updated by Alexander Opitz over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cfc24d7bdc9cd75e5c6b91e0f86130124436dc90.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21041
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/21042
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/21042
Updated by Alexander Opitz over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset cd3fb13003b8f3eeb6a0566e857a39ac016b1cd2.
Updated by Thomas Allmer over 11 years ago
it seems that AFTER 6.0.4? we now have two different Exceptions FileDoesNotExistException and FolderDoesNotExistException... so we have to catch them both
I did it like this
} catch(\Exception $e) { if ($e instanceof \TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException OR $e instanceof \TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException) { // no file or folder - nothing to do } else { // Rethrow the Exception throw $e; } }
Updated by Alexander Opitz over 11 years ago
Hi Thomas,
can you verify this with the newer Version 6.0.6? If yes, what needs to be done to reproduce the FileDoesNotExistException with 6.0.6?
The correct solution is following:
} catch (\TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException $folderNotFoundException) { // Nothing to be done if folder not found } catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $fileNotFoundException) { // Nothing to be done if file not found }
Updated by Henrik Ziegenhain over 11 years ago
Something strange here.
Could it be, that the patch set 2 for branch TYPO3_6-0 was never merged?
I updated recently to 6.0.6 and got a folder not found exception, because a pdf file was deleted in the meanwhile.
I am not sure, if this Exception was there before.
After applying patch set 2 everything in the backend is working again.
Updated by Alexander Opitz over 11 years ago
The fix was merged after the 6.0.6 release and so it will be in 6.0.7
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed