Project

General

Profile

Actions

Bug #100563

closed

Unable to get property "type" of non-object "getTSFE()" in TYPO3 12.4.0-dev when using condition getTSFE().type in backend context

Added by Alex Kellner over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-04-12
Due date:
% Done:

100%

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

Description

I just updated from TYPO3 12.2 to 12.4.0-dev and faced an issue in LUXletter when opening the own backend module.
This seems to be related to this TypoScript:

[getTSFE().type == 1562349004]
...
[end]

Playing with [traverse(page,'type') == 1562349004] but this seems not to work in frontend.

Any help for me here?

Related to: https://github.com/in2code-de/luxletter/issues/174


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #100237: Deprecate two TypoScript related ExceptionsClosed2023-03-21

Actions
Related to TYPO3 Core - Task #100672: Correct examples around getTSFE() in changelogsClosedChris Müller2023-04-19

Actions
Actions #1

Updated by Christian Kuhn over 1 year ago

Is this triggered by extbase BackendConfigurationManager? Could you provide the full backtrace? We may need to adapt extbase in this case a bit.

Actions #2

Updated by Christian Kuhn over 1 year ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78622

Actions #4

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78622

Actions #5

Updated by Oliver Bartsch over 1 year ago

  • Related to Task #100237: Deprecate two TypoScript related Exceptions added
Actions #6

Updated by Oliver Bartsch over 1 year ago

Hi Alex,

this is most probably due to the changes in #100237. Those changes were necessary after cleaning up the whole expression language implementation in #100047. You have to adjust your TypoScript to check for TSFE being available. Previously, the whole condition evaluated to FALSE if TSFE was not available, e.g. in backend context. Since #100237 however, the function (getTSFE()) itself returns FALSE in case TSFE is not available. To prevent the corresponding exception, the following check has to be used: [getTSFE() && getTSFE().type 1562349004].

I now created a patch which aligns the behaviour of getTSFE() to return NULL instead of FALSE. This allows to also use the null-safe operator ?. You will then be able to use [getTSFE()?.type 1562349004]. This is in line with the other expresion functions, like site or siteLanguage.

I hope this helps and I'm sorry for the inconveniences.

Best, Oli

Actions #7

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78622

Actions #8

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78622

Actions #9

Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78622

Actions #10

Updated by Alex Kellner over 1 year ago

Thx for digging into it.

I think a change to:

[getTSFE() && getTSFE().type == 1562349004]
...

Should do it for now

Actions #11

Updated by Oliver Bartsch over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Chris Müller over 1 year ago

  • Related to Task #100672: Correct examples around getTSFE() in changelogs added
Actions #13

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF