#110016typolink forceAbsoluteUrl returns ":///path" for file and path links
Description
Since TYPO3 v14, `typolink.forceAbsoluteUrl = 1` produces broken URLs like `:///path/to/file.jpg` (empty scheme and host) for links whose target is a file or a root-relative path — e.g. URLs coming from `IMG_RESOURCE`.
Reproduce
Minimal TypoScript on any TYPO3 v14 site (default site configuration, no special `config.` settings required):
page.10 = TEXT
page.10.typolink {
parameter.cObject = IMG_RESOURCE
parameter.cObject.file = EXT:my_sitepackage/Resources/Public/Images/example.jpg
returnLast = url
forceAbsoluteUrl = 1
}
Or this example here https://forge.typo3.org/issues/101709
### Expected result
https://example.org/_assets/hash/Images/example.jpg
### Actual result
:///_assets/hash/Images/example.jpg
### Analysis
Seems the regression was introduced in commit
(“[!!!][FEATURE] Add TypolinkBuilderInterface with automatic DI”, https://review.typo3.org/c/Packages/TYPO3.CMS/+/86036).
In `AbstractTypolinkBuilder::forceAbsoluteUrl()`, the assignment of scheme
and host was accidentally moved inside the
`FrontendUrlPrefix->getUrlPrefix($request) === ‘’` condition:
// v14 (broken):
if (empty($urlParts[‘host’])) {
if (GeneralUtility::makeInstance(FrontendUrlPrefix::class)->getUrlPrefix($request) === ‘’) {
// scheme, host and path are only set here …
}
$isUrlModified = true; // … but the URL is re-assembled anyway
}
In v13 the equivalent code always set scheme and host; only the
site-path prepending was conditional on `absRefPrefix`:
// v13 (working):
if (empty($urlParts[‘host’])) {
$urlParts[‘scheme’] = $normalizedParams->isHttps() ? ‘https’ : ‘http’;
$urlParts[‘host’] = $normalizedParams->getHttpHost();
$urlParts[‘path’] = ‘/’ . ltrim($urlParts[‘path’], ‘/’);
// absRefPrefix has been prepended to $url beforehand
// so we only modify the path if no absRefPrefix has been set
if ($this->getTypoScriptFrontendController()->absRefPrefix === ‘’) {
$urlParts[‘path’] = $normalizedParams->getSitePath() . ltrim($urlParts[‘path’], ‘/’);
}
$isUrlModified = true;
}
Because `$isUrlModified` is still set to `true`, the URL is re-assembled
from the parts array (`scheme . ‘://’ . host . path`) with empty scheme
and host, resulting in `:///path`.
Reviews 2
Related issues 1
History 711
-
Garvin Hicking changed category Is Regression 1 <span data-processor="relativetime" data-value="2026-06-07T19:38:09+00:00" > 06/07/26, 19:38 </span>
-
Garvin Hicking changed Related to #106405 <span data-processor="relativetime" data-value="2026-06-07T19:38:54+00:00" > 06/07/26, 19:38 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-06-07T19:40:35+00:00" > 06/07/26, 19:40 </span>
-
Sven Juergens commented <span data-processor="relativetime" data-value="2026-06-08T08:36:58+00:00" > 06/08/26, 08:36 </span>
Hi @ghi thanks a lot, I had the help from AI :)
I had another look, and it seems there is already a (pending?) patch from Benni Mack?
https://review.typo3.org/c/Packages/TYPO3.CMS/+/91257 -
Gerrit Code Review pushed patch set 3 for main to change 91257 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-08T09:14:15+00:00" > 06/08/26, 09:14 </span> -
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-06-08T09:17:22+00:00" > 06/08/26, 09:17 </span>
Ah yes. That patch needs a regression test. Will try to find time for it :)
-
Gerrit Code Review pushed patch set 4 for main to change 91257 <span data-processor="relativetime" data-value="2026-06-08T09:42:49+00:00" > 06/08/26, 09:42 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 91257 <span data-processor="relativetime" data-value="2026-06-08T20:59:09+00:00" > 06/08/26, 20:59 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 94446 <span data-processor="relativetime" data-value="2026-06-09T21:52:37+00:00" > 06/09/26, 21:52 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-06-09T22:35:09+00:00" > 06/09/26, 22:35 </span>Applied in changeset commit:46aadfaefee407aff493f708bcb521a58307dad5.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-08-11T08:50:52+00:00" > 08/11/26, 08:50 </span>
Thanks for this well-crafted report! Would you like to offer a patch to attribute to you? Else I can work on it (or help you). :-)