Project

General

Profile

Actions

Bug #97324

closed

CSS / JS files not referenced correctly when concatenation and compression are disabled

Added by Marco Kuprat over 2 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2022-04-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

After updating a site from TYPO3 10.4 to 11.5.8 I encountered following problem:
The frontend of subpages from level 2 got messed up, because CSS and JS files were not referenced correctly (loading those files resulted in a 404 error).

Example TypoScript setup in order to reproduce the error:

config.minifyCSS = 0
config.concatenateCss = 0
config.compressCss = 0
config.minifyJs = 0
config.concatenateJs = 0
config.compressJs = 0

page.includeCSS.mycss = fileadmin/mycss.css
page.includeJS.myjs = fileadmin/myjs.js

In TYPO3 11.5 the CSS and JS files are referenced like this:
<link rel="stylesheet" type="text/css" href="fileadmin/mycss.css">
<script src="fileadmin/myjs.js?1570519026"></script>

Whereas in TYPO3 10.4 they were referenced with a prepending slash:
<link rel="stylesheet" type="text/css" href="/fileadmin/mycss.css">
<script src="/fileadmin/myjs.js?1570519026"></script>

So on subpages like https://www.domain.xy/page-1/subpage-1-1/ the references lead to a 404 error.

Setting config.absRefPrefix = / (or any other values) in TypoScript does not help.
However it works when config.baseURL is set, but that is deprecated.
Also, the problem does not exist as soon as config.concatenateCss = 1 or config.compressCSS = 1 are set (JS respectively), because in that case the references look like " /typo3temp/assets/compressed... "


Related issues 2 (2 open0 closed)

Related to TYPO3 Core - Bug #99135: page.includeCSS with resource from fileadmin, the beginning slash is missing TYPO3 11.5.19New2022-11-19

Actions
Related to TYPO3 Core - Bug #82574: Inconsistent support of config.absRefPrefix in fluid/extbaseNew2017-09-28

Actions
Actions

Also available in: Atom PDF