in2code-de / luxletter

Newsletter system for TYPO3

Home Page:https://www.in2code.de/agentur/typo3-extensions/luxletter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with typoScript [getTSFE().type == 1562349004] in TYPO3 12

Padina42 opened this issue · comments

The shown bug (screenshot) is caused by a condition in the typoscript [getTSFE().type == 1562349004] . (Call of the log-module in the TYPO3-backend. The same trouble will seen in the modules scheduler and reports)

2023-04-09 18_53_28-TYPO3 Exception · düddelei  TYPO3 CMS 12 3 0  — Mozilla Firefox

Thx for your feedback. I'm wondering what could cause the issue? When I look into official documentation, the writings seems to be ok:

[getTSFE().type == 98]
...

https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#gettsfe


Update: I cannot reproduce the issue in TYPO3 12.3.0

I am wondering, why my system crash.
If I include your typoscript (screenshot), then I get the exception after clicking on the log-module. The same exception will occur, if i try to use your luxletter-module in the backend (after clearing the cache)
If I exclude your typoscript via comment, then I can see my logs or see the output of your luxletter-BE-module.

========================
You are right. The syntax is okay. I mentioned the problem yesterday on slack and got the following idea from Stefan Bürk.
Dieter Porth
9:20 AM
Additional remark to yesterday: The shown bug caused by a condition in the typoscript [getTSFE().type == 1562349004] . I am looking for a workaround. Is there an alternative way to detect the typeNum of a page in the typoscript-condition? Will something like [traverse(page,'type') == 1562349004] work?

Stefan Bürk
:dancing_penguin: 10:59 AM
@Padina42
You should check if getTESFE() is there at all ... TSFE is a Frontend thing, and may not be properly instantiated in BE context. Sadly, Extbase needs TSFE even in BE context, thus bootstrapping it - but not having a TSFE properly set.
You should therefore guard access to purely FE stuff by using the traverse() , e.g. for the type check:
[traverse(getTSFE(), 'type') == 1562349004]

Ok, I just updated to the latest 12 branch 12.4.0-dev and can reproduce the issue now on my testsystem (12.2 was used before).

I just opened an issue on forge for this: https://forge.typo3.org/issues/100563

I just released version 19.2.2 what should fix this issue

Version 19.2.2 in the TER would be great too.
https://extensions.typo3.org/extension/luxletter

You could update to the latest version in TER?
Explanation: Not all versions are available in TER because this extension needs to be installed via composer. And of course every version is available in packagist for composer.

OK, thanks for your reply.