#105191TypoScript condition with missing traverse breaks log module
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.
Reviews 2
Related issues 2
History 610
-
Lina Wolf changed PHP Version 8.2 <span data-processor="relativetime" data-value="2024-10-04T05:59:09+00:00" > 10/04/24, 05:59 </span>
-
Lina Wolf changed Related to #100047 <span data-processor="relativetime" data-value="2024-10-04T05:59:42+00:00" > 10/04/24, 05:59 </span>
-
Lina Wolf changed Related to #100345 <span data-processor="relativetime" data-value="2024-10-04T06:00:26+00:00" > 10/04/24, 06:00 </span>
-
Nikita Hovratov commented <span data-processor="relativetime" data-value="2024-10-11T15:24:51+00:00" > 10/11/24, 15:24 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 86980 status
NewUnder Review <span data-processor="relativetime" data-value="2024-11-13T08:51:52+00:00" > 11/13/24, 08:51 </span> -
Gerrit Code Review pushed patch set 2 for main to change 86980 <span data-processor="relativetime" data-value="2024-11-13T08:59:20+00:00" > 11/13/24, 08:59 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 86980 <span data-processor="relativetime" data-value="2024-11-13T18:44:18+00:00" > 11/13/24, 18:44 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88440 <span data-processor="relativetime" data-value="2025-03-03T12:30:34+00:00" > 03/03/25, 12:30 </span>
-
Mathias Brodala commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-03-03T13:00:09+00:00" > 03/03/25, 13:00 </span>Applied in changeset commit:dfd6bec1f33bd33045ab8f9a721fbb9fa407e2e2.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:32:49+00:00" > 12/02/25, 14:32 </span>
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.