bithost-gmbh / pdfviewhelpers

TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.
GNU General Public License v3.0
44 stars 21 forks source link

Use [getTSFE() && getTSFE().type == 1617455214] instead of [getTSFE().type == 1617455214] #242

Open criwe opened 1 month ago

criwe commented 1 month ago

Describe the bug Some sites in the Backend can´t be accessed anymore (Extensions, Backend Users), when [getTSFE().type == 1617455214] is used in Setup / Constants.

Environment TYPO3 version(s): 12.4.19 pdfviewhelpers version: v3.0.0 PHP 8.3

Steps to reproduce Install pdfviewhelpers, insert typo3script to configure the extension, try to access the "Extensions" page. An errorpage shows up:

503
Oops, an error occurred!
Unable to get property "type" of non-object "getTSFE()".)

Errorlog says:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Unable to get property "type" of non-object "getTSFE()". | RuntimeException thrown in file /vendor/symfony/expression-language/Node/GetAttrNode.php in line 86. Requested URL: typo3/module/tools/ExtensionmanagerExtensionmanager?token=--AnonymizedToken--

Expected behavior Backend should work .

Possible solution Use [getTSFE() && getTSFE().type == 1617455214] instead of [getTSFE().type == 1617455214] (that works in my case)

(see https://forge.typo3.org/issues/100563)

maechler commented 1 month ago

Hi @criwe

Thanks for reaching out and the detailed report! I think however this error is not originating from the pdfviewhelpers extension, if you are in fact using v3.0.0. The page type 1617455214 is not part of this extension and is probably coming from another TypoScript file in your project. This same issue in the pdfviewhelpers - EXT:news TypoScript template has been fixed a while ago: https://github.com/bithost-gmbh/pdfviewhelpers/commit/def914cc1383f5bc3653deacec46f715c1fa4a49

https://github.com/bithost-gmbh/pdfviewhelpers/blob/117becb4462cced6d307f64f252279566babc1ab/Configuration/TypoScript/Extensions/News/setup.typoscript#L1

I however just noticed that it's not yet updated in the documentation, I will do that.

Kind regards Markus