Bug #83630

Config.absRefPrefix not working anymore for includeCSS, includeJs, includeJSLibs, includeCSSLibs after update to 8.7.9

Added by Frederick d. Maus over 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2018-01-21
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Hello typo3 team

after a typo3 update from 8.7.8 to 8.7.9 i get the problem that the includeJSLibs, includeCSS, includeCSSLibs, ... Links are not anymore absolute in the frontend. Images files works. It means absRefPrefix not works anymore.

greets


Related issues

Related to TYPO3 Core - Task #77589: Allow EXT: syntax in PageRenderer and Compressor Closed 2016-08-22
Duplicated by TYPO3 Core - Bug #82486: IncludeJS* / includeCSS* (including compression / concatenation) ignoring absRefPrefix Closed 2017-09-14

Associated revisions

Revision 0162ff19 (diff)
Added by Oliver Hader over 1 year ago

[BUGFIX] Handle config.absRefPrefix on JS/CSS files correctly again

Issue #77589 introduced automatic resolving of relative paths during
v8.4.0 development in the PageRenderer component. Doing this in some
backend context is fine - however if applied for frontend rendering,
config.absRefPrefix was not applied anymore to these files.

Reason for this behavior is applying PathUtility::getAbsoluteWebPath
which prefixes files with /<TYPO3_SITE_PATH>/ - however absRefPrefix
only works on relative URIs. Extending the absRefPrefix patterns in
TypoScriptFrontendController::setAbsRefPrefix() by mentioned prefix
would adjust explicitly defined absolute paths as well.

To solve this bug, the prefix /<TYPO3_SITE_PATH>/ is
not applied in frontend rendering contexts anymore.

Resolves: #83630
Releases: master, 8.7
Change-Id: Ib01f698c14fb646173ec24e26027c7d657700f87
Reviewed-on: https://review.typo3.org/56108
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision 83f279ae (diff)
Added by Oliver Hader over 1 year ago

[BUGFIX] Handle config.absRefPrefix on JS/CSS files correctly again

Issue #77589 introduced automatic resolving of relative paths during
v8.4.0 development in the PageRenderer component. Doing this in some
backend context is fine - however if applied for frontend rendering,
config.absRefPrefix was not applied anymore to these files.

Reason for this behavior is applying PathUtility::getAbsoluteWebPath
which prefixes files with /<TYPO3_SITE_PATH>/ - however absRefPrefix
only works on relative URIs. Extending the absRefPrefix patterns in
TypoScriptFrontendController::setAbsRefPrefix() by mentioned prefix
would adjust explicitly defined absolute paths as well.

To solve this bug, the prefix /<TYPO3_SITE_PATH>/ is
not applied in frontend rendering contexts anymore.

Resolves: #83630
Releases: master, 8.7
Change-Id: Ib01f698c14fb646173ec24e26027c7d657700f87
Reviewed-on: https://review.typo3.org/56126
Reviewed-by: Stefan Neufeind <>
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

History

#1 Updated by Riccardo De Contardi over 1 year ago

I performed the following test with 8.7.9 (fresh install):

config{
  no_cache = 1
  absRefPrefix = http://typo3.8.test/
}

page.includeCSS {
  file1 = fileadmin/teststylesheet.css
}

Results:

the stylesheet in <head> don't have the prepended absRefPrefix:

<link rel="stylesheet" type="text/css" href="/typo3temp/assets/css/d42b6e1bdf.css?1510479815" media="all">
<link rel="stylesheet" type="text/css" href="/fileadmin/teststylesheet.css?1516558177" media="all">

All other links (like header links of content elements, HMENU object, links inserted in RTE) instead have http://typo3.8.test/ prepended.

I don't have an 8.7.8 environment, but I performed the same test on 7.6.23 and it works as expected.

#2 Updated by Riccardo De Contardi over 1 year ago

  • Subject changed from typo3 update from 8.7.8 to 8.7.9 to Config.absRefPrefix not working anymore for includeCSS, includeJs, includeJSLibs, includeCSSLibs after update to 8.7.9

#3 Updated by Georg Ringer over 1 year ago

  • Is Regression set to Yes

#4 Updated by Georg Ringer over 1 year ago

i tested it even with 8.7.0 and is still prefixed with / only!

#5 Updated by Riccardo De Contardi over 1 year ago

Affects also 9.2.0-dev (latest master)

#6 Updated by Riccardo De Contardi over 1 year ago

  • Related to Bug #77722: absRefPrefix is not applied everywhere added

#7 Updated by Riccardo De Contardi over 1 year ago

  • Related to Bug #82486: IncludeJS* / includeCSS* (including compression / concatenation) ignoring absRefPrefix added

#8 Updated by Riccardo De Contardi over 1 year ago

There is a suggestion in #82486

#9 Updated by Oliver Hader over 1 year ago

  • Target version set to 8.7.11

#10 Updated by Georg Ringer over 1 year ago

IMO this doesnt even work with 7. can someone confirm?

#11 Updated by Oliver Hader over 1 year ago

Works in TYPO3 v7.6.25-dev, did not work in v8.7.0... so, that's not a recent "regression"...

#12 Updated by Oliver Hader over 1 year ago

  • Related to Task #77589: Allow EXT: syntax in PageRenderer and Compressor added

#13 Updated by Oliver Hader over 1 year ago

Introduced in #77589 which automatically prefixes with an absolute prefix / in PageRenderer::getStreamlinedFileName.
The according absRefPrefix handling in TypoScriptFrontendController::setAbsRefPrefix does not consider the leading slash whatsoever.

This behavior has been introduced in TYPO3 v8.4.0 already and thus is not a recent regression in the 8.7 LTS branch.

#14 Updated by Oliver Hader over 1 year ago

Two possible ways to solve this:
  • in TSFE extend the absRefPrefix search/replace logic by TYPO3_SITE_PATH prefix replacements (which does not cover if this has been used explicitly)
  • add special handling in PageRenderer whether to apply TYPO3_SITE_PATH at all (default might be true, disabled in PageGenerator - cave: PageRenderer is used for frontend and backend, TYPO3_SITE_PATH is perfectly fine and valid for backend usage)

#15 Updated by Markus Klein over 1 year ago

  • Duplicated by Bug #82486: IncludeJS* / includeCSS* (including compression / concatenation) ignoring absRefPrefix added

#16 Updated by Markus Klein over 1 year ago

  • Related to deleted (Bug #82486: IncludeJS* / includeCSS* (including compression / concatenation) ignoring absRefPrefix)

#17 Updated by Oliver Hader over 1 year ago

  • Status changed from New to In Progress

#18 Updated by Oliver Hader over 1 year ago

  • Related to deleted (Bug #77722: absRefPrefix is not applied everywhere)

#19 Updated by Oliver Hader over 1 year ago

Removed reference to #77722 which is about extending the absRefPrefix functionality to any mention of those files - this is not related to this bug, but rather a new feature or behavior.

#20 Updated by Gerrit Code Review over 1 year ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#21 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#22 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#23 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#24 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#25 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#26 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56108

#27 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56126

#28 Updated by Oliver Hader over 1 year ago

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

#29 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF