Bug #100563
closedUnable to get property "type" of non-object "getTSFE()" in TYPO3 12.4.0-dev when using condition getTSFE().type in backend context
100%
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
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.
Updated by Christian Kuhn over 1 year ago
- Status changed from New to Needs Feedback
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
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
Updated by Oliver Bartsch over 1 year ago
- Related to Task #100237: Deprecate two TypoScript related Exceptions added
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
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
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
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
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
Updated by Oliver Bartsch over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 490d53d05b197e63c3fb3dbc30d2fa221421722c.
Updated by Chris Müller over 1 year ago
- Related to Task #100672: Correct examples around getTSFE() in changelogs added