Bug #101701
closedPathUtility::getAbsoluteWebPath() create wrong asset path in composer with TYPO3 12
100%
Description
There is an error in the path generation in connection with TYPO3 12 and PathUtility::getAbsoluteWebPath() in Composer.
if the asset path contains "Resources/Public" more than once.
Example:
- TYPO3 12 installation with composer
- Installing news
- Installation "sitepackage" (for example)
copy "news-basic.css" to sitepackage to the following path:
sitepackage/Resources/Public/ExtensionOverwrite/news/Resources/Public/Css/
then use this TypoScript
plugin.tx_news { settings { cssFile = EXT:sitepackage/Resources/Public/ExtensionOverwrite/news/Resources/Public/Css/news-basic.css } }
Generated Path:
<link href="/_assets/bb36f0f8e61571e2a51d4a09a953e97d/ExtensionOverwrite/news/?1692215767" rel="stylesheet" >
Should:
<link href="/_assets/bb36f0f8e61571e2a51d4a09a953e97d/ExtensionOverwrite/news/Resources/Public/Css/news-basic.css?1692215826" rel="stylesheet" >
Problem is this line in in PathUtility::class
https://github.com/TYPO3/typo3/blob/d7f24355efc58fb6f749fd26214a3d43e9d0ed24/typo3/sysext/core/Classes/Utility/PathUtility.php#L69
Because "Resources/Public" occurs several times, a problem arises in connection with explode()
The problem could be solved with a limit in explode().
[$relativePrefix, $relativeAssetPath] = explode('Resources/Public', $relativePath, 2);
Updated by Sven Juergens about 1 year ago
may be it's helpful:
the problem does not exist in TYPO3 11, as this check returns true if the extension is in typo3conf/ext/.
The path checked here is then (with ddev)
$targetPath: /var/www/html/public/typo3conf/ext/sitepackage/Resources/Public/ExtensionOverwrite/news/Resources/Public/Css/news-basic.css Environment::getPublicPath(): "/var/www/html/public"
in TYPO3 12
$targetPath: /var/www/html/vendor/typo3conf/ext/sitepackage/Resources/Public/ExtensionOverwrite/news/Resources/Public/Css/news-basic.css Environment::getPublicPath(): "/var/www/html/public"
Updated by Garvin Hicking 11 months ago
- Related to Bug #101911: TYPO3 composer mode does not properly respect installations in a subdirectory added
Updated by Garvin Hicking 3 months ago
- Related to deleted (Bug #101911: TYPO3 composer mode does not properly respect installations in a subdirectory)
Updated by Gerrit Code Review 3 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84181
Updated by Gerrit Code Review 3 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84181
Updated by Gerrit Code Review 3 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84194
Updated by Markus Klein 3 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 19a2d873e6974060456080d2340d1c19a49bae26.