PHP Error (and Fix) in Resources Module

I’m using PHP v7.2 and got the following error in the Resources module:

Warning: count(): Parameter must be an array or an object that implements Countable in …/resource/class/html.formresource.class.php on line 103

The following code is my fix:

CHANGE
$num = count($resourcestat->lines);
TO
$num = is_array($resourcestat->lines);

1 Like

Hi,

Thanks, but all the Bugs and fixs must be posted on Git : https://github.com/Dolibarr/dolibarr/issues