From b52c3a2fd93b795220b639fd6278b5e729c931f3 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Fri, 19 Sep 2025 16:29:27 +0200 Subject: [PATCH 1/2] [!!!][TASK] Remove TypoScript getTSFE() condition function Releases: main --- Documentation/Conditions/Index.rst | 36 +++++++---------------- Documentation/Syntax/Conditions/Index.rst | 13 ++++---- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/Documentation/Conditions/Index.rst b/Documentation/Conditions/Index.rst index cb606a07..77e9623d 100644 --- a/Documentation/Conditions/Index.rst +++ b/Documentation/Conditions/Index.rst @@ -839,37 +839,23 @@ compatVersion() [END] -.. index:: Conditions; getTSFE .. _condition-function-getTSFE: +.. _condition-function-getTSFE-migration: -getTSFE() -========= - -.. confval:: getTSFE() - :name: condition-getTSFE - :type: Object - - Provides access to :ref:`TypoScriptFrontendController ` - :php:`$GLOBALS['TSFE']`. This function can directly access methods of - :php:`TypoScriptFrontendController`. This class is target of a mid-term - refactoring. It should be used with care since it will eventually vanish in - the future. +getTSFE(): Migration +==================== - Using the :typoscript:`getTSFE()` function, developers have to ensure that - "TSFE" is available before accessing its properties. A missing "TSFE", for - example, in backend context, does no longer automatically evaluate the whole - condition to :php:`false`. Instead, the function returns :php:`null`, which - can be checked using either :typoscript:`[getTSFE() && getTSFE().id == 17]` - or the null-safe operator :typoscript:`[getTSFE()?.id == 17]`. +.. versionchanged:: 14.0 + `Breaking: #107473 - TypoScript condition function getTSFE() removed `_ + The TypoScript condition function `getTSFE()` has been removed. Using a + condition like `getTSFE()` will never evaluate to true and needs adaption. - Example: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript +.. code-block:: diff + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript (dif) - # True, if the current page UID is 17. Use the page variable instead - [getTSFE()?.id == 17] + - [getTSFE() && getTSFE().id == 42] + + [request?.getPageArguments()?.getPageId() == 42] .. index:: Conditions; getenv .. _condition-function-getenv: diff --git a/Documentation/Syntax/Conditions/Index.rst b/Documentation/Syntax/Conditions/Index.rst index 6f6fa9d9..f764eac5 100644 --- a/Documentation/Syntax/Conditions/Index.rst +++ b/Documentation/Syntax/Conditions/Index.rst @@ -159,16 +159,15 @@ Using the null-safe operator in conditions .. versionadded:: 12.1 Using the null-safe operator is possible when accessing properties on objects -which might not be available in some context, for example `TSFE` in the -backend: +which might not be available in some context, for example +`request() `_ +in the backend: -.. code-block:: typoscript +.. code-block:: diff - # Previously - # [getTSFE() && getTSFE().id == 123] + - [request && request.getPageArguments() && request.getPageArguments().getPageId() == 42] - # Now - [getTSFE()?.id == 123] + + [request?.getPageArguments()?.getPageId() == 42] .. _typoscript-syntax-syntax-value: From 77b03c5356c8ce44853768bfdca035ea5b63035a Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Sat, 20 Sep 2025 08:18:40 +0200 Subject: [PATCH 2/2] Update Documentation/Conditions/Index.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stefan Frömken --- Documentation/Conditions/Index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Conditions/Index.rst b/Documentation/Conditions/Index.rst index 77e9623d..bccacc6b 100644 --- a/Documentation/Conditions/Index.rst +++ b/Documentation/Conditions/Index.rst @@ -851,7 +851,7 @@ getTSFE(): Migration condition like `getTSFE()` will never evaluate to true and needs adaption. .. code-block:: diff - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript (dif) + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript (diff) - [getTSFE() && getTSFE().id == 42]