Page 2 of 2

Re: PHP8 causes errors on loading the main form

Posted: Thu Dec 08, 2022 9:59 am
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.

Re: PHP8 causes errors on loading the main form

Posted: Thu Dec 08, 2022 1:27 pm
by kev1n
[File removed: Fixed are on Github]

Re: PHP8 causes errors on loading the main form

Posted: Thu Dec 08, 2022 9:05 pm
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
********************************

Re: PHP8 causes errors on loading the main form

Posted: Fri Dec 09, 2022 5:00 am
by kev1n
nuLookupRecord() can only be used in the After Browse event of a Lookup object.

Re: PHP8 causes errors on loading the main form

Posted: Thu Dec 15, 2022 8:01 pm
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

Re: PHP8 causes errors on loading the main form

Posted: Thu Dec 15, 2022 8:34 pm
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

Re: PHP8 causes errors on loading the main form

Posted: Mon Dec 19, 2022 5:53 pm
by kev1n
Updated \core\libs\tcpdf and core/nurunpdf on Github