Closed TYPO3IncTeam closed 1 year ago
The UriBuilder is not really explained in "TYPO3 Explained". However, it is available in the outdated Extbase book: https://docs.typo3.org/m/typo3/guide-extbasefluid/main/en-us/Extbase/Step3Documentation/ActionController.html#uribuilder
As a preparation for mentioning this deprecation, the UriBuilder should be moved from the Extbase book to "TYPO3 explained" into the Extbase chapter.
:information_source: View this commit on Github :busts_in_silhouette: Authored by Anja Leichsenring aleichsenring@ab-softlab.de :heavy_check_mark: Merged by Christian Kuhn lolli@schwarzbu.ch
Commit message
[TASK] Use local Request Object in Extbase UriBuilder
The EXT:extbase UriBuilder already has a local instance of the RequestInterface object, but relies in its method
buildBackendUrl()
solely on $GLOBALS['TYPO3_REQUEST'].This is now cleaned up, with a fallback on the global object in case none has been given as a local instance. In this case, a deprecation warning will be raised.
Resolves: #99650 Releases: main Change-Id: Ib05a92c999e83e19cfde65a038439e3f571afba7 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77507 Tested-by: Stefan Bürk stefan@buerk.tech Reviewed-by: Christian Kuhn lolli@schwarzbu.ch Tested-by: Oliver Bartsch bo@cedev.de Tested-by: Christian Kuhn lolli@schwarzbu.ch Reviewed-by: Oliver Bartsch bo@cedev.de Reviewed-by: Stefan Bürk stefan@buerk.tech Tested-by: core-ci typo3@b13.com
:heavy_plus_sign: Added files
12.2/Deprecation-99650-ExtbaseUriBuilderGlobalRequest.rst
```rst .. include:: /Includes.rst.txt .. _deprecation-99650-1674205203: ======================================================================= Deprecation: #99650 - Global Request object usage in Extbase UriBuilder ======================================================================= See :issue:`99650` Description =========== Usage of the global request object (:php:`$GLOBALS['TYPO3_REQUEST']`) as fallback in the EXT:extbase :php:`\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder` has been deprecated and will be removed in TYPO3 v13. The :php:`UriBuilder` will then solely rely on a locally set request object. Impact ====== Using the :php:`UriBuilder` class of extbase without a local request object will trigger a PHP deprecation warning. Affected installations ====================== TYPO3 installations with custom extensions initializing the :php:`UriBuilder` without handing in a request object and using it to build URIs. Migration ========= Make sure to call :php:`setRequest($request)` before using the :php:`UriBuilder`, when no other component has done this already. Using ViewHelpers won't trigger the warning, as TYPO3 Core will take care by itself to ensure the proper setup. .. index:: PHP-API, FullyScanned, ext:core ```