Project

General

Profile

Actions

Bug #84261

closed

PageRenderer Includes and config.compress/concatenate CSS/JS does not work

Added by Paul Beck about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2018-03-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When including JS and CSS files using the Pagerenderer in some Extbase actions the config.compress/concatenate function will break with a WARNING.

Example include in an Extbase Controller Action:

$pageRenderer = $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
$pageRenderer->addJsFooterFile('EXT:myext/Resources/Public/Javascripts/my.js');

Then enable the compression in the Typoscript configuration and you will get this warning:

file_get_contents(/home/www/p123456789/html/typo3conf/ext/myext/Resources/Public/Javascripts/my.js): failed to open stream

The path is stripping a path segment to the TYPO3_path it should be this instead:

/home/www/p123456789/html/*TYPO3*/typo3conf/ext/myext/Resources/Public/Javascripts/my.js

Somehow, files that are included using the PageRenderer will be delivered relative to the RessourceCompressor like:

"../typo3conf/ext/myext/Resources/Public/Javascripts/my.js"

Line 284 of RessourceCompressor will then strip it away and remove the /typo3/-part of the path in this line:

$filenameAbsolute = GeneralUtility::resolveBackPath($this->rootPath . $filename);
Actions

Also available in: Atom PDF