Page 1 of 1

Reports Quit working today

Posted: Thu Feb 09, 2023 9:06 pm
by BoydG
Starting getting this today, reports quit working today, they have been working for months with no problem.

substr(): Passing null to parameter #1 ($string) of type string is deprecated in /core/nurunpdf.php on line 399
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /core/nurunpdf.php on line 670

PHP Warning: Undefined array key "obj1005" in /core/nurunpdf.php on line 534
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /nurunpdf.php:534
Stack trace:
#0 /core/nurunpdf.php(383): nuSECTION->chopSectionOverPages()
#1 /core/nurunpdf.php(232): nuSECTION->buildSection()
#2 /core/nurunpdf.php(68): nuBuildReport(Object(TCPDF), Object(stdClass), '___nu163e54fed4...')
#3 /core/nurunpdf.php(23): nuRunReportId('63e54fecbb897ee', '', true)
#4 {main}
thrown in /core/nurunpdf.php on line 534


PHP Version 8.1.14

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 7:13 am
by kev1n
Did you update your PHP version?
Are you using the latest from Github? (It contains some PHP 8.x fixed)

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 12:37 pm
by BoydG
I tried version 8 and 7.4.33 of php and it's still doing it.
it's a running on a hosted server so i'm not sure what else changed.
I tried creating a new report using the same sql query as the broken one and I can't even get report designer to work.
I just get a blank page, so it might be a sql problem ?

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 12:38 pm
by kev1n
Are you using the latest from Github? (It contains some PHP 8.x fixed)

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 1:01 pm
by BoydG
I had a case statement in the SQL query, once I removed that, I was able to get into SQL designer to figure out what obj1005 was.
I found several objects with a minimum rows of -1
this was causing the
PHP Warning: Undefined array key "obj1005" in /core/nurunpdf.php on line 534
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /nurunpdf.php:534

I'm still investigating why the case statement causes the report designer not to display

If I find anything i'll let you know.

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 1:04 pm
by BoydG
i'm not using the the latest on git because initially i thought that was the problem and upgraded to that version, then it cause even more errors so i rolledit back to V.4.5-2022.10.29.04

so i'm currently running V.4.5-2022.10.29.04 and PHP 8.0

once i get this back and running i'll try to upgrade to the latest git and php 8.1

Re: Reports Quit working today

Posted: Fri Feb 10, 2023 1:36 pm
by BoydG
Fixed the case statement.
Issue: Duplicate column name.

even though my select statement did not include the column name, my case statement used a column name that did exist as a column in the database.


Example:
Table 1 contains columns A,B,C,D

SQL Query
Select A,B,C
case ......
end as D

the end as statement (end as D) contained column D which existed in the database.
Even though I didn't specifically select it, it caused a duplicate.

Fix
SQL Query
Select A,B,C
case ......
end as E