Skip to content

[TASK] Declare TypoScriptFrontendController deprecated #1074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TYPO3IncTeam opened this issue Oct 8, 2024 · 1 comment
Open

[TASK] Declare TypoScriptFrontendController deprecated #1074

TYPO3IncTeam opened this issue Oct 8, 2024 · 1 comment

Comments

@TYPO3IncTeam
Copy link
Collaborator

ℹ️ View this commit on Github
👥 Authored by Christian Kuhn [email protected]
✔️ Merged by Christian Kuhn [email protected]

Commit message

[TASK] Declare TypoScriptFrontendController deprecated

We worked hard on TypoScriptFrontendController in TYPO3 v13
leaving mainly internal code and usages. A couple of details
are still left open, and we can't tackle them in v13 anymore
due to time constraints. The most notable area is the main
content generation trigger and the *_INT processing.

However, all non-internal usages by extensions can be
substituted. Usually by using new attributes of the request.

The goal is still to get rid of TypoScriptFrontendController
in TYPO3 v14. The patch prepares this by declaring
TypoScriptFrontendController fully deprecated, even though
with some left over internal usages. TYPO3 v14 will see a
few preparation patches to reach this goal.

The patch polishes a ReST file from 13.0 to add some more
"Use this instead" information, and adds a new ReST file
declaring TypoScriptFrontendController and $GLOBALS['TSFE']
deprecated.

Resolves: #105230
Resolves: #105046
Related: #102621
Related: #104217
Releases: main
Change-Id: I0d9ab50e4be9724895f5f2763c0be2ab731cd9f0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86493
Reviewed-by: Oliver Bartsch [email protected]
Reviewed-by: Christian Kuhn [email protected]
Tested-by: Christian Kuhn [email protected]
Reviewed-by: Stefan Bürk [email protected]
Tested-by: core-ci [email protected]
Tested-by: Stefan Bürk [email protected]
Reviewed-by: Andreas Kienast [email protected]
Tested-by: Oliver Bartsch [email protected]

➕ Added files

13.4/Deprecation-105230-TypoScriptFrontendControllerAndGLOBALSTSFE.rst
..  include:: /Includes.rst.txt

..  _deprecation-105230-1728374467:

========================================================================
Deprecation: #105230 - TypoScriptFrontendController and $GLOBALS['TSFE']
========================================================================

See :issue:`105230`

Description
===========

Class :php:`TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController` and
its global instance :php:`$GLOBALS['TSFE']` have been marked as deprecated.
The class will be removed with TYPO3 v14.


Impact
======

Calling :php:`TypoScriptFrontendController` methods, or accessing state from
:php:`$GLOBALS['TSFE']` is considered deprecated.


Affected installations
======================

Various instances may still retrieve information from :php:`$GLOBALS['TSFE']`.
Remaining uses should be adapted. The extension scanner will find possible
matches.

To keep backwards compatibility in TYPO3 v13, some calls can not raise
deprecation level log messages.


Migration
=========

See :ref:`breaking-102621-1701937690` for details on substitutions. In general,
most state used by extensions has been turned into request attributes.

..  index:: Frontend, PHP-API, FullyScanned, ext:frontend

➗ Modified files

13.0/Breaking-102621-MostTSFEMembersMarkedInternalOrRead-only.rst
@@ -44,22 +44,26 @@ but never write" for extensions. This allows implementation of a deprecation lay
 further notice. A similar strategy is added for methods, leaving only a few not
 marked :php:`@internal`, which the Core will deprecate with a compatibility layer later.
 
-The following public class properties have been marked "read-only":
+The following public class properties have been marked "read-only", and have later been
+deprecated with the full deprecation of :php:`TypoScriptFrontendController` in
+TYPO3 v13.4, see :ref:`deprecation-105230-1728374467`.
 
 * :php:`TypoScriptFrontendController->id` - Use :php:`$request->getAttribute('frontend.page.information')->getId()` instead
 * :php:`TypoScriptFrontendController->rootLine` - Use :php:`$request->getAttribute('frontend.page.information')->getRootLine()` instead
 * :php:`TypoScriptFrontendController->page` - Use :php:`$request->getAttribute('frontend.page.information')->getPageRecord()` instead
 * :php:`TypoScriptFrontendController->contentPid` - Avoid usages altogether, available as :php:`@internal` call using
   :php:`$request->getAttribute('frontend.page.information')->getContentFromPid()`
 * :php:`TypoScriptFrontendController->sys_page` - Avoid altogether, create own instance using :php:`GeneralUtility::makeInstance(PageRepository::class)`
-* :php:`TypoScriptFrontendController->config` - Reading :php:`$tsfe->config['config']` and :php:`$tsfe->config['rootLine']` is allowed
-* :php:`TypoScriptFrontendController->absRefPrefix`
-* :php:`TypoScriptFrontendController->cObj`
+* :php:`TypoScriptFrontendController->config` - Use :php:`$request->getAttribute('frontend.typoscript')->getConfigArray()` instead of :php:`config['config']`
+* :php:`TypoScriptFrontendController->cObj` - Create an own :php:`ContentObjectRenderer` instance, call :php:`setRequest($request)`
+  and :php:`start($request->getAttribute('frontend.page.information')->getPageRecord(), 'pages')`
 * :php:`TypoScriptFrontendController->config['rootLine']` - Use :php:`$request->getAttribute('frontend.page.information')->getLocalRootLine()` instead
 
 The following public class properties have been marked :php:`@internal` - in general
-all properties not listed above:
+all properties not listed above. They contain information usually not relevant within
+extensions. The TYPO3 core will model them differently.
 
+* :php:`TypoScriptFrontendController->absRefPrefix`
 * :php:`TypoScriptFrontendController->no_cache` - Use request attribute :php:`frontend.cache.instruction` instead
 * :php:`TypoScriptFrontendController->additionalHeaderData`
 * :php:`TypoScriptFrontendController->additionalFooterData`
@@ -70,7 +74,7 @@ all properties not listed above:
 * :php:`TypoScriptFrontendController->content`
 * :php:`TypoScriptFrontendController->lastImgResourceInfo`
 
-The following methods have been marked :php:`@internal`:
+The following methods have been marked :php:`@internal` and may vanish anytime:
 
 * :php:`TypoScriptFrontendController->__construct()` - extensions should not create own instances of TSFE
 * :php:`TypoScriptFrontendController->determineId()`
@@ -89,12 +93,14 @@ The following methods have been marked :php:`@internal`:
 * :php:`TypoScriptFrontendController->logDeprecatedTyposcript()`
 * :php:`TypoScriptFrontendController->uniqueHash()`
 * :php:`TypoScriptFrontendController->set_cache_timeout_default()`
+* :php:`TypoScriptFrontendController->set_no_cache()` - Use :php:`$request->getAttribute('frontend.cache.instruction')->disableCache()` instead
+* :php:`TypoScriptFrontendController->sL()` - Use :php:`GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromSiteLanguage($request->getAttribute('language'))->sL()`` instead
 * :php:`TypoScriptFrontendController->get_cache_timeout()`
 * :php:`TypoScriptFrontendController->getRequestedId()` - Use :php:`$request->getAttribute('routing')->getPageId()` instead
-* :php:`TypoScriptFrontendController->getLanguage()`
-* :php:`TypoScriptFrontendController->getSite()`
+* :php:`TypoScriptFrontendController->getLanguage()` - Use :php:`$request->getAttribute('site')->getDefaultLanguage()` instead
+* :php:`TypoScriptFrontendController->getSite()` - Use :php:`$request->getAttribute('site')` instead
 * :php:`TypoScriptFrontendController->getContext()` - Use dependency injection or :php:`GeneralUtility::makeInstance()` instead
-* :php:`TypoScriptFrontendController->getPageArguments()`
+* :php:`TypoScriptFrontendController->getPageArguments()` - Use :php:`$request->getAttribute('routing')` instead
 
 Impact
 ======
@linawolf linawolf assigned linawolf and unassigned linawolf Oct 14, 2024
@brotkrueml brotkrueml self-assigned this Oct 23, 2024
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 23, 2024
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 23, 2024
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 24, 2024
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 24, 2024
froemken pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 25, 2024
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
The TypoScriptFrontendController has been marked as deprecated with TYPO3 v13.4.
Therefore, this example has been adjusted to avoid calling TSFE methods.

Additionally:

- The whole class is marked as readonly.
- The "do something" comment is removed as it does not serve any purpose here.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
#4930)

The TypoScriptFrontendController has been marked as deprecated with TYPO3 v13.4.
Therefore, this example has been adjusted to avoid calling TSFE methods.

Additionally:

- The whole class is marked as readonly.
- The "do something" comment is removed as it does not serve any purpose here.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
The TypoScriptFrontendController has been marked as deprecated with TYPO3 v13.4.
Therefore, this example has been adjusted to avoid calling TSFE methods.

Additionally:

- The whole class is marked as readonly.
- The "do something" comment is removed as it does not serve any purpose here.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
#4931)

The TypoScriptFrontendController has been marked as deprecated with TYPO3 v13.4.
Therefore, this example has been adjusted to avoid calling TSFE methods.

Additionally:

- The whole class is marked as readonly.
- The "do something" comment is removed as it does not serve any purpose here.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

Co-authored-by: Chris Müller <[email protected]>
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
TypoScriptFrontendController has been deprecated with TYPO3 v13. Therefore,
the mentions of TSFE have been removed in those chapters.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
…ers (#4933)

TypoScriptFrontendController has been deprecated with TYPO3 v13. Therefore,
the mentions of TSFE have been removed in those chapters.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
TypoScriptFrontendController has been deprecated with TYPO3 v13. Therefore,
the mentions of TSFE have been removed in those chapters.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 28, 2024
…ers (#4934)

TypoScriptFrontendController has been deprecated with TYPO3 v13. Therefore,
the mentions of TSFE have been removed in those chapters.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

Co-authored-by: Chris Müller <[email protected]>
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 29, 2024
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 29, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

`TSFE->sys_page` holds an instance of the `PageRepository`, therefore this is a suitable substitution.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this issue Oct 29, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 29, 2024
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this issue Oct 31, 2024
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

`TSFE->sys_page` holds an instance of the `PageRepository`, therefore this is a suitable substitution.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

`TSFE->sys_page` holds an instance of the `PageRepository`, therefore this is a suitable substitution.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

`TSFE->sys_page` holds an instance of the `PageRepository`, therefore this is a suitable substitution.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

Co-authored-by: Chris Müller <[email protected]>
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

Related: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/9.4/Deprecation-85543-Language-relatedPropertiesInTypoScriptFrontendControllerAndPageRepository.html#migration
Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

Co-authored-by: Chris Müller <[email protected]>
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14.
Therefore, this mentioning has to be dropped.

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

Co-authored-by: Chris Müller <[email protected]>
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Nov 1, 2024
* [TASK] #105230 - Declare TypoScriptFrontendController deprecated

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

* Add deprecation for TSFE in "Global Variables" chapter
linawolf pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-CoreApi that referenced this issue Jan 16, 2025
* [TASK] #105230 - Declare TypoScriptFrontendController deprecated

Related: TYPO3-Documentation/Changelog-To-Doc#1074
Releases: main, 13.4

* Add deprecation for TSFE in "Global Variables" chapter

(cherry picked from commit 218e70f)
@linawolf linawolf reopened this Feb 19, 2025
@linawolf
Copy link
Member

We need to document it here: https://docs.typo3.org/permalink/t3tsref:top-level-objects-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants