Deprecation: #100584 - GeneralUtility::linkThisScript()
See forge#100584
Description
The method \TYPO3\
has been marked as deprecated and should not be used any longer.
The method uses the super global $_
which should be avoided. Instead,
data should be retrieved via the PSR-7 Server
.
Controllers should typically create URLs using the \TYPO3\
.
Impact
Using the method triggers a deprecation level log entry in TYPO3 v12, the method will be removed with TYPO3 v13.
Affected installations
The method was typically used in backend context: Extensions with own backend modules may be affected. The extension scanner finds usages with a strong match.
Migration
link
was typically used when a link to some view is
created that should return back to the current view later.
Controllers usually "know" the route a view should return to and the relevant GET parameters.
A transition could look like this:
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$queryParams = $request->getQueryParams();
$url = $uriBuilder->buildUriFromRoute(
'my_route',
[
'table' => $queryParams['table'] ?? '',
'uid' => (int)($queryParams['uid'] ?? 0),
]
);