jDownloads Support Forum

jDownloads for Joomla 3.x => jDownloads 3.9 (Support ended) => Bugs => Topic started by: youp on 15.06.2021 14:28:26

Title: Upload error count Argument must be of type Countable array[Solved]
Post by: youp on 15.06.2021 14:28:26
Hi!

When I try to upload a file from the frontend, I get this error message: "0 count(): Argument #1 ($var) must be of type Countable|array, null given". I am using


php8.0/MySQL5.7/joomla 3.9.27 /jDownloads Version 3.9.7.3

I found here a similar (in German?) issue due to php version?

Thanks in advance.
Title: Re: Upload error count Argument must be of type Countable array
Post by: ColinM on 15.06.2021 18:39:45
Hi
First reaction is  it looks like a PHP version 8 challenge in defining a variable!  Will investigate as so far I have been using PHP v7 series.  But could be a definition in a database field.

Could you please advise  which part of the front end - was it in Creating a new Download or Editting an existing one?
Colin
Title: Re: Upload error count Argument must be of type Countable array
Post by: youp on 16.06.2021 13:46:56
Hi,
Thanks for the reply!
I tested both: it occurs both in Creating a new Download or Editting an existing one.
Title: Re: Upload error count Argument must be of type Countable array
Post by: ColinM on 17.06.2021 09:49:19
Youp
This is a PHP 8 related problem that was also running in another topic.  Specificallyhttp://www.jdownloads.com/forum/index.php?topic=12388.msg46306#msg46306
The solution was to cast a specific variable to an integer
For convenience I have attached the replacement filethe instructions from Arno are
Quoteplease try the (unzipped) attached file. Copy it to \components\com_jdownloads\views\category\
Try it then again and post here your result. Thanks.
Could you please see if that cures the problem otherwise we have another 'challenge'
Colin
Title: Re: Upload error count Argument must be of type Countable array
Post by: youp on 18.06.2021 19:03:49
Hi Colin,
Thanks and sorry I did not see the mentioned message, do not hesitate to close this one and I will continue on the other if needed.
Unfortunately this does not solved the issue. On the other hand, it might be another error message? Please find attached the exact way the message is delivered: just my top bar menu and a blank page with this.
How can I help with other information?
Title: Re: Upload error count Argument must be of type Countable array
Post by: ColinM on 19.06.2021 17:01:42
YuopCould you try this one pleaseAfter unzipping copy the file view.html.php to  \components\com_jdownloads\views\category\
double chech you have categorry not categories
File view.html.php should have at line 316
if ($menu && ($menu->query['option'] != 'com_jdownloads' || $menu->query['view'] != 'category' || $id !== (int) $this->category->id)) {Colin
Title: Re: Upload error count Argument must be of type Countable array
Post by: youp on 20.06.2021 11:37:29
Hi Colin,

Thanks again for your message!
Unfortunately it did not work. I double checked I am in "category" not "categories". I also reset Options, Categories and Downloads Permissions in the "Tools" panel, without success neither.

Sorry.

What can I do to help solving this issue? This is a fresh install of JDownloads, it is ok if I remove it to reinstall, or change all the needed options.

Best,
There was also another problem in multilingual setup that was not related to the above errorColin
Title: Re: Upload error count Argument must be of type Countable array
Post by: ColinM on 20.06.2021 16:06:10
Youp
Have sent you a PM (Private Message)
Colin
Title: Re: Upload error count Argument must be of type Countable array
Post by: tobias.bucher on 14.10.2021 14:30:57
Sorry for hijacking / grave digging this, but I have exactly this issue with Joomla 3.10.2, JD 3.9, PHP 8.0.11. Was there a solution for this?







Cheers
Title: Re: Upload error count Argument must be of type Countable array
Post by: ColinM on 14.10.2021 19:23:21
Tobias
Yes there is a solution
please try the (unzipped) attached file. Copy it to \components\com_jdownloads\views\category\
Please make sure you use category not categories
If you have a multilingual siter then please let us know
Colin