Author Topic: count(): Parameter must be an array or an object  (Read 2651 times)

artonweb

  • Beginner
  • *
  • Posts: 27
    • Art On web
count(): Parameter must be an array or an object
« 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?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10124
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: count(): Parameter must be an array or an object
« Reply #1 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?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

artonweb

  • Beginner
  • *
  • Posts: 27
    • Art On web
Re: count(): Parameter must be an array or an object
« Reply #2 on: May 12, 2020, 21:25:41 pm »
Hello.
I am using PHP 7.3 and all products have prices.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10124
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: count(): Parameter must be an array or an object
« Reply #3 on: June 15, 2020, 11:04:38 am »
Did you update?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/