Topic: - count(): Parameter must be an array


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\ at line 293
D:\Users\shipl\htdocs\fa24\includes\     (db_pager Object)->_sql_gen('1')
D:\Users\shipl\htdocs\fa24\includes\     (db_pager Object)->_init()
D:\Users\shipl\htdocs\fa24\includes\     (db_pager Object)->query()
D:\Users\shipl\htdocs\fa24\includes\ui\     (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, 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;


    var    $extra_where = array();

Hope this helps.


Re: - count(): Parameter must be an array

Thanks. Fixed and committed to Repo.