- Posts: 6218
COMMUNITY FORUM
Parameter must be an array
- JoomlaWorks
- Offline
- Admin
Less
More
5 years 9 months ago #171200
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Parameter must be an array
This is your template's override that conflicts with PHP 7.x, not K2. Simply upgrade your overrides like the K2 source template files.
github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php
github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- trogladyte
- Offline
- Senior Member
Less
More
- Posts: 61
5 years 2 months ago #173071
by trogladyte
Replied by trogladyte on topic Parameter must be an array
I just upgraded my server from PHP7.1.31 to PHP7.3.x yesterday as I was getting EOL warnings from Joomla. Since that, I can confirm that this K2 warning has now appeared,
Warning: count(): Parameter must be an array or an object that implements Countable in /home/tastewas/public_html/components/com_k2/models/item.php on line 763
While I understand that it's only a warning and only appears if the error reporting in Joomla is set to anything other than none or Sys Def, and it doesn't affect site operation, does this not mean that the K2 code isn't completely in line with current PHP versions?
Warning: count(): Parameter must be an array or an object that implements Countable in /home/tastewas/public_html/components/com_k2/models/item.php on line 763
While I understand that it's only a warning and only appears if the error reporting in Joomla is set to anything other than none or Sys Def, and it doesn't affect site operation, does this not mean that the K2 code isn't completely in line with current PHP versions?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
5 years 2 months ago #173072
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Parameter must be an array
Please upgrade to K2 v2.10.0 (dev) from github.com/getk2/k2/archive/master.zip - these warnings are resolved there.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Blutch
- Offline
- New Member
Less
More
- Posts: 5
4 years 10 months ago #174252
by Blutch
Replied by Blutch on topic Parameter must be an array
Hello,
I just had an error preventing my site from working in frontend. The error is :
[02-Jan-2020 11:18:29 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in [...]/templates/sandal/html/com_k2/templates/default/item.php on line 187
[02-Jan-2020 11:18:33 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in [...]/templates/sandal/html/com_k2/templates/default/category.php on line 137
I can't figure out how to fix this problem when everything is working properly backend. Could you help me ?
PHP Version 7.2.26
Web Server Apache
WebServer to PHP Interface litespeed
Joomla! 3.9.14 Stable [ Amani ] 17-December-2019 15:00 GMT
Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
thanks a lot !
Blutch
I just had an error preventing my site from working in frontend. The error is :
[02-Jan-2020 11:18:29 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in [...]/templates/sandal/html/com_k2/templates/default/item.php on line 187
[02-Jan-2020 11:18:33 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in [...]/templates/sandal/html/com_k2/templates/default/category.php on line 137
I can't figure out how to fix this problem when everything is working properly backend. Could you help me ?
PHP Version 7.2.26
Web Server Apache
WebServer to PHP Interface litespeed
Joomla! 3.9.14 Stable [ Amani ] 17-December-2019 15:00 GMT
Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
thanks a lot !
Blutch
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 10 months ago #174253
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Parameter must be an array
You need to update your K2 overrides slightly as described here:
www.joomlaworks.net/forum/k2-en/51379-warning-parameter-must-be-an-array-or-an-object-that-implements
www.joomlaworks.net/forum/k2-en/51379-warning-parameter-must-be-an-array-or-an-object-that-implements
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.