Deprecation: #94193 - Public url with relative paths in FAL API

See Issue #94193

Description

The public FAL API for accessing the public url of a FAL object, e.g. FileReference or Folder, previously allowed to retrieve the relative path instead of the absolute path. This could be achieved by setting $relativeToCurrentScript to true while calling getPublicUrl().

However, only under some circumstances FAL is actually able to build such relative links. If at all, this only worked for local drivers. Other drivers would still return the absolute URL, which has often led to unexpected side-effects.

Since both, frontend (site handling) and backend (url routing) are meanwhile fully capable of supporting absolute URLs, $relativeToCurrentScript is now deprecated and will finally be removed in TYPO3 v12.0.

This also affects the isRelativeToCurrentScript() method in the GeneratePublicUrlForResourceEvent event, as well as the OnlineMediaHelperInterface.

Impact

Calling getPublicUrl() on a FAL object, e.g. FileReference or Folder, with $relativeToCurrentScript set to true will trigger a PHP E_USER_DEPRECATED error. The extension scanner will detect such calls.

Accessing isRelativeToCurrentScript() on GeneratePublicUrlForResourceEvent will trigger a PHP E_USER_DEPRECATED error. The extension scanner will detect such calls.

Manually calling getPublicUrl() on an OnlineMediaHelper, e.g. YoutubeHelper, will not trigger a PHP E_USER_DEPRECATED error, but the extension scanner will detect such calls.

Affected Installations

All installations which set $relativeToCurrentScript to true when calling getPublicUrl() on a FAL object, e.g. FileReference or Folder.

All installations which manually call getPublicUrl() on an OnlineMediaHelper, e.g. YoutubeRenderer.

All installation which access isRelativeToCurrentScript() on the GeneratePublicUrlForResourceEvent event.

Migration

Remove the $relativeToCurrentScript parameter from all calls to getPublicUrl() on FAL objects, e.g. FileReference or Folder.

Remove the $relativeToCurrentScript parameter from all manual calls to getPublicUrl() on an OnlineMediaHelper, e.g. YoutubeHelper.

Remove all calls to GeneratePublicUrlForResourceEvent->isRelativeToCurrentScript().