bithost-gmbh / pdfviewhelpers

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

Compatibility issues with News Extension version 11.1.1 #230

Closed sns-ck closed 10 months ago

sns-ck commented 1 year ago

We have included the link for generating a PDF as described in the tutorial on the news detail pages, which has worked great with News Extension Versions 9.3 and 10.0.3 so far. After the upgrade to 11.1.2, however, this has changed and when calling up a detail page with ?type=28032013, only a white/empty page is rendered without using the custom template to generate the PDF view.

TYPO3 Version 11.5.30 PdfViewHelper Version: 2.5.0

maechler commented 1 year ago

@sns-ck I tested this with TYPO3 v11 and news v11 and I think it should be working. Can you please check the error log and provide additional information about the error? Maybe the error is related to the PHP version used.

DL1ndner commented 10 months ago

I can confirm this issue on TYPO3 12.4.8 with EXT:news v 11.2.0 and pdfviewhelpers:dev-main Error log shows

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

This seems to caused by EXT:pdfviewhelpers/Configuration/TypoScript/Extensions/News/setup.typoscript, line 1: [getTSFE().type == 28032013] According to https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#gettsfe, we should better use the null-safe variant [getTSFE()?.type == 28032013] (or the traverse condition) With this change pdf output is working here.

maechler commented 10 months ago

@DL1ndner Thank you very much for the analysis and suggesting a fix! I think we might have to go for [getTSFE() && getTSFE().id == 28032013] for TYPO3 v11 compatibility though.

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.1/Feature-100586-Null-safeOperatorInTypoScriptConditions.html