VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: anex on July 14, 2024, 18:05:54 PM

Title: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: anex on July 14, 2024, 18:05:54 PM
Hello boys and girls. I have the following issue when I am trying to access my Vm shop. The installation is new.

Please be so kind to help :)
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Margriet on July 16, 2024, 08:10:03 AM
Me too. Fresh install Joomla 5.1.2, PHP 8.2, VM 4.2.12
And in this thread (https://forum.virtuemart.net/index.php?topic=152013.0) problem is mentionned as well.
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: sohopros on July 26, 2024, 15:55:37 PM
We also see this error in VM ver. VirtueMart 4.2.12 11014 PHP 8.1.29 - recently updated. The error is here on the individual shopper screen: administrator/index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=5001

An error has occurred.

    0 count(): Argument #1 ($value) must be of type Countable|array, null given

Please help!
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Jumbo! on July 26, 2024, 18:23:23 PM
Quote from: sohopros on July 26, 2024, 15:55:37 PMWe also see this error in VM ver. VirtueMart 4.2.12 11014 PHP 8.1.29 - recently updated. The error is here on the individual shopper screen: administrator/index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=5001

An error has occurred.

    0 count(): Argument #1 ($value) must be of type Countable|array, null given

Please help!

The solution is here: https://forum.virtuemart.net/index.php?topic=152013.0.
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: sohopros on July 26, 2024, 21:25:32 PM
Thanks Jumbo! We'll give that a try. Kind of amazing that we have to hack 3 core files to get the software to work, but I suppose that is "Brand Virtuemart". And now it will be un-updatable, or do you think this fix will be in the next release?
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Jumbo! on July 26, 2024, 23:25:30 PM
Quote from: sohopros on July 26, 2024, 21:25:32 PMThanks Jumbo! We'll give that a try. Kind of amazing that we have to hack 3 core files to get the software to work, but I suppose that is "Brand Virtuemart". And now it will be un-updatable, or do you think this fix will be in the next release?

I believe my guess is as good as yours.
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Milbo on August 07, 2024, 15:33:48 PM
sohopros
that was fixed in my local core one day later afte report and of course fixed in vm4.2.14, which was released a week after the release of vm4.2.12.

So members had this problem just a week and most members did not notice it, actually
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Trond on August 15, 2024, 19:23:43 PM
I have the same problem now, on 4.3.4  It happens on some product pages, but not all, and only on child products. If I delete the child product and create a new one, the customers can order the child product a couple of times, then the error comes back, and I have to delete/create again. Is there a permanent fix that will work even after a new update?
Title: Re: An error has occurred. 0 count(): Argument #1 ($value) must be of type Countable
Post by: Trond on August 15, 2024, 20:14:41 PM
Sorry, my mistake. That was the Joomla version. My Virtuemart version is 4.2.12. I will wait for the 4.2.14 to get available