Welcome to the nuBuilder Forums!

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

PHP8 causes errors on loading the main form

Questions related to using nuBuilder Forte.
potap
Posts: 28
Joined: Wed Nov 23, 2022 1:07 pm
Has thanked: 6 times
Been thanked: 1 time

Re: PHP8 causes errors on loading the main form

Unread post by potap »

on line 1396 I put - return $php;
on line 277 I added - if ($value==null) {$value='';}

looks like it works for now. Correct me if I did something wrong, because actually I'm not a programmer.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: PHP8 causes errors on loading the main form

Unread post by kev1n »

[File removed: Fixed are on Github]
potap
Posts: 28
Joined: Wed Nov 23, 2022 1:07 pm
Has thanked: 6 times
Been thanked: 1 time

Re: PHP8 causes errors on loading the main form

Unread post by potap »

Kevin, thank you for your help.
It worked. But I came across another problem. I'm not sure whether it relates to php8 or not. I've created small registration app, that was ok for my purposes for the beginning, I just didn't like the silent db constraint errors. As I understood, while looking thru the forum, that db constraints don't work with nuBuilder and I have to check data before SQL insert\update manually. So, I started to learn how to do it, and tried to run nuLookupRecord(). Actually it was pretty easy code of two lines in After Save of Brows\Edit form (later I tried on Before Save, BeforeEdit - same result):

$l=nuLookupRecord();
nuDebug($l);

But when I run it, I get an error (in php8). I thought that maybe it is connected with php version again, so I switched back to php7, and there were no warning, but the problem were still on the scene - the Debug record was empty ([0].)? although the data were in the fields of edit form. With php8 at least I get warning. Can you please advice on what is wrong here. So, here is the beginning of the error message that I get:

*********************************
Uncaught Error.


Warning: Undefined array key "lookup_row" in C:\Server\data\htdocs\nuBuilder4\core\nuform.php on line 881
********************************
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: PHP8 causes errors on loading the main form

Unread post by kev1n »

nuLookupRecord() can only be used in the After Browse event of a Lookup object.
potap
Posts: 28
Joined: Wed Nov 23, 2022 1:07 pm
Has thanked: 6 times
Been thanked: 1 time

Re: PHP8 causes errors on loading the main form

Unread post by potap »

Started to look into Reports. Got errors again:

Deprecated: addslashes(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 1102

Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php:2005 Stack trace: #0 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php(2005): array_map(Array, false) #1 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\tcpdf.php(6395): TCPDF_FONTS::UTF8StringToArray('\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', true, Array) #2 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\tcpdf.php(5972): TCPDF->Write(4.409722, '\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', '', 0, 'L', true, 0, false, true, 0, 0, Array) #3 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(978): TCPDF->MultiCell(25.0, 5.0, '\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', 0, 'L', 1, 0, 1.25, 55.75, true, 0, false, false) #4 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(184): nuPrintField(Object(TCPDF), Object(stdClass), Object(stdClass), Object(stdClass), Object(stdClass), false) #5 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(78): nuPrintReport(Object(TCPDF), Object(stdClass), Array, Object(stdClass), false) #6 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(23): nuRunReportId('639b707e869101e', '', true) #7 {main} thrown in C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php on line 2005
potap
Posts: 28
Joined: Wed Nov 23, 2022 1:07 pm
Has thanked: 6 times
Been thanked: 1 time

Re: PHP8 causes errors on loading the main form

Unread post by potap »

And others

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 399

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 670

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 399

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 670

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 399

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php on line 670

Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php:2005 Stack trace: #0 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php(2005): array_map(Array, false) #1 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\tcpdf.php(6395): TCPDF_FONTS::UTF8StringToArray('\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', true, Array) #2 C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\tcpdf.php(5972): TCPDF->Write(4.409722, '\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', '', 0, 'L', true, 0, false, true, 0, 0, Array) #3 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(978): TCPDF->MultiCell(25.0, 5.0, '\xD0\x92\xD0\xBE\xD0\xBB\xD0\xBE\xD0\n\xBD\xD1\x82\xD0\xB5...', 0, 'L', 1, 0, 1.25, 45.75, true, 0, false, false) #4 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(184): nuPrintField(Object(TCPDF), Object(stdClass), Object(stdClass), Object(stdClass), Object(stdClass), false) #5 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(78): nuPrintReport(Object(TCPDF), Object(stdClass), Array, Object(stdClass), false) #6 C:\Server\data\htdocs\nuBuilder4\core\nurunpdf.php(23): nuRunReportId('639b766196f8ffb', '', true) #7 {main} thrown in C:\Server\data\htdocs\nuBuilder4\core\libs\tcpdf\include\tcpdf_fonts.php on line 2005
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: PHP8 causes errors on loading the main form

Unread post by kev1n »

Updated \core\libs\tcpdf and core/nurunpdf on Github
Post Reply