Project

General

Profile

Actions

Bug #35212

closed

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

Added by Xavier Perseguers over 12 years ago. Updated about 6 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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Xavier Perseguers over 12 years ago

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

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

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);
Actions #3

Updated by Xavier Perseguers over 12 years ago

  • Assignee deleted (Xavier Perseguers)
Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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.

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

Updated by Xavier Perseguers about 12 years ago

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

Updated by Xavier Perseguers about 12 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):

Actions #13

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF