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

Core: Error handler (FE): PHP Warning: Undefined array key 0 / -1 - PHP 8+ issue? #246

Open medarob opened 1 week ago

medarob commented 1 week ago

Describe the bug After updating from PHP 7.4 to 8.2.20 we got various PHP warnings regarding TCPDF (6.7.5) in the log. Never noticed this before.

Core: Error handler (FE): PHP Warning: Undefined array key 0 in /var/www/typo3/vendor/tecnickcom/tcpdf/tcpdf.php line 20750 Core: Error handler (FE): PHP Warning: Undefined array key -1 in /var/www/typo3/vendor/tecnickcom/tcpdf/tcpdf.php line 20606 Core: Error handler (FE): PHP Warning: Undefined array key 0 in /var/www/typo3/vendor/tecnickcom/tcpdf/tcpdf.php line 19235

Environment TYPO3 version(s): TYPO3 11.5.38 pdfviewhelpers version: 3.0.0

Steps to reproduce Warning noticed after installing PHP 8 but I won't rule out another issue.

Possible solution There exist a newer version of TCPDF (https://github.com/tecnickcom/tc-lib-pdf) which seems to be (more) compatible with PHP 8.0+ and I wonder if pdfviewhelpers can be changed/updated to use the newer version?

maechler commented 1 week ago

@medarob Thanks for the detailed report! Since pdfviewhelpers v3 we do not include TCPDF directly in the extension anymore for composer installations. We just have it as a dependency and you should be able to update the TCPDF library yourself with composer.

Could you test if updating TCPDF fixes the issue?

For TER installations we still ship the TCPDF library, but I think it‘s with an even older version. We could update this upon request.