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

How to fix virtual gifts - count warning | 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 313 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))

hope that helps..


PS yes i also posted this in the plugin support section :)

The Forum post is edited by dave Mar 10 '20