Project

General

Profile

Actions

Bug #105191

open

TypoScript condition with missing traverse breaks log module

Added by Lina Wolf 27 days ago. Updated 20 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2024-10-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

After updating my TYPO3 installation from TYPO3 v 11.5 to 12.4 I get the following error in trying to open the log backend module:

(1/1) RuntimeException
Unable to get property "type" of non-object "getTSFE()".

in /var/www/html/vendor/symfony/expression-language/Node/GetAttrNode.php line 86

Related to:

https://forge.typo3.org/issues/100047

This was due to having a TypoScript condition without a traverse:

Before:

[getTSFE().type == 1618224993]
    plugin.tx_dpnglossary {
        view.templateRootPaths.10 = EXT:wco_sitepackage_forschung/Resources/Private/Extensions/DpnGlossary/Templates/Ajax
    }
[global]

Fixing the condition resolves the problem:

[traverse(getTSFE(), 'type') == 1618224993]
    plugin.tx_dpnglossary {
        view.templateRootPaths.10 = EXT:wco_sitepackage_forschung/Resources/Private/Extensions/DpnGlossary/Templates/Ajax
    }
[global]

However I think it would be good to add better error handling for conditions and to break with a more meaningful error message and a custom error code where we can add documentation about this error.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #100047: Modernize condition matching / expression handlingClosed2023-02-28

Actions
Related to TYPO3 Core - Bug #100345: Unable to get property "type" of non-object "getTSFE()"Closed2023-03-29

Actions
Actions #1

Updated by Lina Wolf 27 days ago

  • PHP Version set to 8.2
Actions #2

Updated by Lina Wolf 27 days ago

  • Related to Task #100047: Modernize condition matching / expression handling added
Actions #3

Updated by Lina Wolf 27 days ago

  • Related to Bug #100345: Unable to get property "type" of non-object "getTSFE()" added
Actions #4

Updated by Nikita Hovratov 20 days ago

I think this is not so easy, as this is just a "RuntimeException". So we can't just catch it.
As a side note, I would suggest using this https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#page condition instead, as TSFE is already deprecated in v13. The condition will most probably vanish as well.

Actions

Also available in: Atom PDF