VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Coding Central => Topic started by: artonweb on April 29, 2020, 20:25:08 pm

Title: count(): Parameter must be an array or an object
Post by: artonweb on April 29, 2020, 20:25:08 pm
Hello.
I am using Joomla 3.9.18 and Virtuemart 3.6.10
Today I checked my error.log file and I saw the error which  is described below:

PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/..../public_html/administrator/components/com_virtuemart/models/product.php on line 2351

Code: [Select]
if ((isset($pricesToStore['product_price']) and $pricesToStore['product_price']!='' and $pricesToStore['product_price']!=='0') || (isset($childPrices) and count($childPrices)>1)) { 
Is it crucial?If so, how can I get it fixed?
Title: Re: count(): Parameter must be an array or an object
Post by: Milbo on May 11, 2020, 23:11:33 pm
Hmm it is harmless, I would say.

Please update to the last version https://virtuemart.net/news/500-release-of-virtuemart-3-8-and-covid-support-campaign

But I must admit it is quite likely that it keeps there. I think it is a product without prices and you use php7.4?
Title: Re: count(): Parameter must be an array or an object
Post by: artonweb on May 12, 2020, 21:25:41 pm
Hello.
I am using PHP 7.3 and all products have prices.
Title: Re: count(): Parameter must be an array or an object
Post by: Milbo on June 15, 2020, 11:04:38 am
Did you update?