Topic: - Parameter must be an array

I'm getting the following message in Reports and Analysis with code version 2.4.4 (de943e150d36f815a02d4996e532a5e4e7510bc8) and PHP 7.2.3 (XAMPP 2018-03-14) with debugging on.

count(): Parameter must be an array or an object that implements Countable in file: D:\Users\shipl\htdocs\fa24\reporting\includes\ at line 37
d:\Users\shipl\htdocs\fa24\reporting\reports_main.php:34:     (BoxReports Object)->addReportClass('Customer','0')

It seems that the issue is an uncorrected old style class constructor (probably missed as it has been renamed).

I propose the following change to fix the issue.

reporting/includes/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reporting/includes/ b/reporting/includes/
index c872cef0..96134f95 100644
--- a/reporting/includes/
+++ b/reporting/includes/
@@ -26,7 +26,7 @@ class BoxReports
    var $ar_reports;
    var $ctrl_handlers = array();

-    function ReportClasses()
+    function __construct()
        $this->ar_classes = array();


Re: - Parameter must be an array


This is strange, because this is not a constructor. Will try to examine this.


Re: - Parameter must be an array

Ah, I see. This is the only place where the variable ar_classes is declared as an array.

Your solution will fix this issue elegantly.



Re: - Parameter must be an array

Great. Thanks Joe. Glad to help.