Bug #35212
closedCompressor: filemtime(): stat failed in Help > About TYPO3
100%
Description
I first thought it was related to unprivilege Backend user access but the same happens for admin user when opening Help > About TYPO3:
PHP Warning: filemtime() [function.filemtime]: stat failed for /path/to/typo3/xtjs/adapter/ext/ext-base.js in /path/to/typo3_src/t3lib/class.t3lib_compressor.php line 470
After digging into the code, I figured out that t3lib_Compressor
fails to correctly compute relative path from main directory for when compressing JS and CSS files from Core that do not contain the typo3/
prefix but start with either contrib/
or sysext/
.
Files
Updated by Xavier Perseguers over 12 years ago
To see the problem, one should configure typo3conf/localconf.php
:
$TYPO3_CONF_VARS['SYS']['exceptionalErrors'] = 30711;
Updated by Xavier Perseguers over 12 years ago
- Status changed from New to Needs Feedback
Here's the patch to fix that, I'd like to know if this can be reproduced by other persons, and on which TYPO3 versions.
diff --git a/t3lib/class.t3lib_compressor.php b/t3lib/class.t3lib_compressor.php index ec560c9..e8f1ecc 100644 --- a/t3lib/class.t3lib_compressor.php +++ b/t3lib/class.t3lib_compressor.php @@ -490,6 +490,11 @@ class t3lib_Compressor { } } + // if the file is from a special TYPO3 internal directory, add the missing typo3/ prefix + if (is_file(PATH_site . TYPO3_mainDir . $filename)) { + $filename = TYPO3_mainDir . $filename; + } + // build the file path relatively to the PATH_site $backPath = str_replace(TYPO3_mainDir, '', $this->backPath); $file = str_replace($backPath, '', $filename);
Updated by Xavier Perseguers over 12 years ago
- Assignee deleted (
Xavier Perseguers)
Updated by Philipp Gampe over 12 years ago
I can not reproduce this on master currently. I will check if I have any debug stuff enabled in a minute, but I must file another bug first ;)
Updated by Philipp Gampe over 12 years ago
OK, no debug enabled and I can not reproduce on 4.7 either (all on Fedora 16).
Updated by Gerrit Code Review over 12 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/9864
Updated by Philipp Gampe over 12 years ago
I just checked, the code does not differ between 4.6 and master except for the missing: http://review.typo3.org/9872
Please check again after applying that one.
So this must effect either all branches or be a local problem. I did not do a complete research, but I think your patch should be applied to 4.6 and up or we need to find out what is the difference.
Updated by Gerrit Code Review about 12 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14242
Updated by Gerrit Code Review about 12 years ago
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14243
Updated by Gerrit Code Review about 12 years ago
Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/9864
Updated by Xavier Perseguers about 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7bad033f8f707eb7662a8d136990f2686491b955.
Updated by Xavier Perseguers about 12 years ago
- File warning.png warning.png added
For the sake of completeness, here a screenshot of the reproduction of this warning in current latest version of TYPO3 4.6 (thus without this committed patch):