Topic: db_pager.inc - count(): Parameter must be an array
Hi,
Using FA 2.4.4 and PHP 7.2.3 (XAMPP 2018-03-14) with debugging on, I am getting the following error message when loading Customer Allocations:
count(): Parameter must be an array or an object that implements Countable in file: D:\Users\shipl\htdocs\fa24\includes\db_pager.inc at line 293
D:\Users\shipl\htdocs\fa24\includes\db_pager.inc:347: (db_pager Object)->_sql_gen('1')
D:\Users\shipl\htdocs\fa24\includes\db_pager.inc:180: (db_pager Object)->_init()
D:\Users\shipl\htdocs\fa24\includes\db_pager.inc:392: (db_pager Object)->query()
D:\Users\shipl\htdocs\fa24\includes\ui\db_pager_view.inc:45: (db_pager Object)->select_records()
d:\Users\shipl\htdocs\fa24\sales\allocations\customer_allocation_main.php:113: display_db_pager((db_pager Object))
Checking the code for db_pager.inc, while $extra_where is defined on line 52, there are several ways it can be used without being initialized.
I propose changing line 52 from
var $extra_where;
to
var $extra_where = array();
Hope this helps.
Thanks.