Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

TCPDF failed after upgrade to PHP8 on ArchLinux

Questions related to nuBuilder Forte Reports and the Report Builder.
Post Reply
hf2094
Posts: 22
Joined: Wed Jan 07, 2015 7:11 pm
Been thanked: 2 times

TCPDF failed after upgrade to PHP8 on ArchLinux

Unread post by hf2094 »

Hello,

after upgrade to PHP 8.0 report generation fails - see error message below.
The problem does not occur, when the report size is only 1 page.
See also php.ini and report example in attachment.
My system is an Up-To-Date ArchLinux with nuBuilder-4.5 from GIT (last git-pull Jan, 29).

Yours (Mit freundlichen Grüssen) Hf


[Sat Jan 30 08:00:55.827172 2021] [php:error] [pid 5637] [client 127.0.0.1:33282] PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in /srv/http/nubuilder/core/libs/tcpdf/include/tcpdf_fonts.php:2002\n
Stack trace:\n
#0 /srv/http/nubuilder/core/libs/tcpdf/include/tcpdf_fonts.php(2002): array_map()\n
#1 /srv/http/nubuilder/core/libs/tcpdf/tcpdf.php(4056): TCPDF_FONTS::UTF8StringToArray()\n
#2 /srv/http/nubuilder/core/nurunpdf.php(695): TCPDF->GetStringWidth()\n
#3 /srv/http/nubuilder/core/nurunpdf.php(642): nuSECTION->getOneRow()\n
#4 /srv/http/nubuilder/core/nurunpdf.php(392): nuSECTION->getObjectRows()\n
#5 /srv/http/nubuilder/core/nurunpdf.php(343): nuSECTION->setObjectLines()\n
#6 /srv/http/nubuilder/core/nurunpdf.php(256): nuSECTION->buildSection()\n
#7 /srv/http/nubuilder/core/nurunpdf.php(59): nuBuildReport()\n
#8 {main}\n
thrown in /srv/http/nubuilder/core/libs/tcpdf/include/tcpdf_fonts.php on line 2002,
referer: http://....
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: TCPDF failed after upgrade to PHP8 on ArchLinux

Unread post by kev1n »

Unfortunately I could not reproduce the issue (PHP 8, latest nuBuilder 4.5.)
Would it be possible to upload a sample DB?
You do not have the required permissions to view the files attached to this post.
hf2094
Posts: 22
Joined: Wed Jan 07, 2015 7:11 pm
Been thanked: 2 times

Re: TCPDF failed after upgrade to PHP8 on ArchLinux

Unread post by hf2094 »

Hello,
I found the problem - but not the solution. The problem lays in TCPDF. TCPDF cannot deal with German Umlauts. The error occurs only, when there is a Umlaut in a report field. Reports with no Umlauts are generated as expected.
About two years ago I had a similar problem with TCPDF. Then I took TCPDF from GIT and put it into nuBuilder.

I'll keep you informed..
Yours (Mit freundlichen Grüssen) Hf
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: TCPDF failed after upgrade to PHP8 on ArchLinux

Unread post by kev1n »

Try it with the modified tcpdf.php in the attachment.

Replace this file: core/libs/tcpdf/tcpdf.php
You do not have the required permissions to view the files attached to this post.
hf2094
Posts: 22
Joined: Wed Jan 07, 2015 7:11 pm
Been thanked: 2 times

Re: TCPDF failed after upgrade to PHP8 on ArchLinux

Unread post by hf2094 »

Hello,
thank you for your reply. It never gets to this point you mention in you code . When I start the report I get an empty screen instead of the report and the error message in .../http/error_log.

I put a echo ($str) into nubuilder/core/libs/tcpdf/include/tcpdf_fonts.php:2001. See attachment for output: It breaks when a Umlaut is detected.

More precisely: It failes only in php8 if a line break shall be inserted into a text string with Umlaut.
There is no problem with Umlaut in short strings and no problem with long strings with no Umlaut.
It is a problem of tcpdf with php 8.

Thank you for your support
Hf
Post Reply