Fixed bug #12099: Replace "Warning: filemtime(): stat failed" with a nice error messa...
authorRupert Germann <rupi@gmx.li>
Tue, 17 Nov 2009 18:52:51 +0000 (18:52 +0000)
committerRupert Germann <rupi@gmx.li>
Tue, 17 Nov 2009 18:52:51 +0000 (18:52 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6459 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
typo3/sysext/lang/locallang_core.xml

index 9d371a3..bc3a3ab 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed bug #12455: OpenID authentication does not work with PHP 5.3
        * Fixed bug #12054: PHP5.3-Warning about strcmp() parameters in view_help.php (thanks to Stefan Geith)
        * Fixed bug #12195: Renaming write protected file issues a php warning
+       * Fixed bug #12099: Replace "Warning: filemtime(): stat failed" with a nice error message (thanks to Steffen Gebert)
 
 2009-11-17  Oliver Hader  <oliver@typo3.org>
 
index 90fa57d..73759d3 100644 (file)
@@ -1800,6 +1800,17 @@ final class t3lib_BEfunc {
                                        $theFile_abs = PATH_site.($uploaddir?$uploaddir.'/':'').trim($theFile);
                                        $theFile = ($abs?'':'../').($uploaddir?$uploaddir.'/':'').trim($theFile);
 
+                                       if (!is_readable($theFile_abs)) {
+                                               $flashMessage = t3lib_div::makeInstance(
+                                                       't3lib_FlashMessage',
+                                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_missing_text') . ' <abbr title="' . $theFile_abs . '">' . $theFile . '</abbr>',
+                                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_missing'),
+                                                       t3lib_FlashMessage::ERROR
+                                               );
+                                               $thumbData .= $flashMessage->render();
+                                               continue;
+                                       }
+
                                        $check = basename($theFile_abs).':'.filemtime($theFile_abs).':'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
                                        $params = '&file='.rawurlencode($theFile);
                                        $params.= $size?'&size='.$size:'';
index 5f7fc07..9ebe04f 100755 (executable)
@@ -254,6 +254,8 @@ Would you like to save now in order to refresh the display?</label>
                        <label index="warning.header">Important Notice!</label>
                        <label index="warning.backend_reference">The Reference Index table is empty which is likely the result of a recent TYPO3 upgrade. Please go to %sTools&gt;DB Check%s and update the reference index.</label>
                        <label index="warning.memcache_not_usable">Memcache is configured, but connection to memcached failed with these configuration(s):</label>
+                       <label index="warning.file_missing">File is missing!</label>
+                       <label index="warning.file_missing_text">This content element references a file which seems to not exist:</label>
                        <label index="toolbarItems.shortcuts">Shortcuts</label>
                        <label index="toolbarItems.shortcut">Shortcut</label>
                        <label index="toolbarItems.shortcutsGroup">Shortcut Group</label>