We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Fix for - count(): Parameter must be an array or an object - Virtual Gifts | Forum

dave Leader
dave Mar 10 '20
If you run php 7.2

if you get this message on virtual gifts

"count(): Parameter must be an array or an object that implements Countable"

edit  ow_plugins/virtual_gifts/bol/virtual_gifts_service.php  

line 311 change FROM

if(count($idList))

change TO

if(!empty($idList) && count($idList))

the problem is that if it is an null or empty array, it cant be counted, so we have to check for empty as well,  you can also use !is_null in place of empty if you want to. like so

if(!is_null($idList) && count($idList))

or you can even do this:


if(!empty($idList) && count($idList) > 0)

The Forum post is edited by dave Jun 13 '20
Steve Fraden
Steve Fraden May 27 '23
Saw this, thanks for the fix, works like a champ!


You do not have permission to reply this topic