Bug #35212

Compressor: filemtime(): stat failed in Help > About TYPO3

Added by Xavier Perseguers almost 9 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2012-03-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

warning.png (34.8 KB) warning.png Xavier Perseguers, 2012-09-24 08:00

Related issues

Precedes TYPO3 Core - Bug #42054: PHP warning: open_basedir restrictionClosed2012-10-16

Actions
#1

Updated by Xavier Perseguers almost 9 years ago

To see the problem, one should configure typo3conf/localconf.php:

$TYPO3_CONF_VARS['SYS']['exceptionalErrors'] = 30711;
#2

Updated by Xavier Perseguers almost 9 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);
#3

Updated by Xavier Perseguers almost 9 years ago

  • Assignee deleted (Xavier Perseguers)
#4

Updated by Philipp Gampe almost 9 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 ;)

#5

Updated by Philipp Gampe almost 9 years ago

OK, no debug enabled and I can not reproduce on 4.7 either (all on Fedora 16).

#6

Updated by Gerrit Code Review almost 9 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

#7

Updated by Philipp Gampe almost 9 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.

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14242

#9

Updated by Gerrit Code Review over 8 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

#10

Updated by Gerrit Code Review over 8 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

#11

Updated by Xavier Perseguers over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#12

Updated by Xavier Perseguers over 8 years ago

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):

#13

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF