in2code-de / luxletter

Newsletter system for TYPO3
https://www.in2code.de/agentur/typo3-extensions/luxletter/
22 stars 25 forks source link

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

Closed Padina42 closed 1 year ago

Padina42 commented 1 year ago

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

einpraegsam commented 1 year ago

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

Padina42 commented 1 year ago

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]

Padina42 commented 1 year ago

2023-04-11 18_55_26-README md – setup typoscript

einpraegsam commented 1 year ago

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).

einpraegsam commented 1 year ago

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

einpraegsam commented 1 year ago

I just released version 19.2.2 what should fix this issue

bihor commented 1 year ago

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

einpraegsam commented 1 year ago

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.

bihor commented 1 year ago

OK, thanks for your reply.