getk2/k2

Category listing errors with PHP 8.1.11

escuta opened this issue · 5 comments

Hello,

I am using K2 version 2.11.0 installed from the Git source (as of today, 24/10/2022) and Joomla 3.10.11. With PHP 8.1.11, category listings of K2 items show correctly, however, when a listed item is opened, it produces the following error:

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

With PHP 7.3.12, everything is fine. Is there a fix for this problem in 8.1?

Thanks

@escuta Are you using k2 with the helix framework?

No I'm not but thanks, @raramuridesign , it is indeed a template that's causing the problem. Will close the issue.

@escuta could you share which template and what you did to solve this ?

@raramuridesign
Yes, it is an out-of-date JA_Nuevo template by Joomlart. Changing the problem page to use the beez3 template stops the error. Will update the Nuevo template, need to renew the subscription...

Had a similar error with Joomla 3.10 with Helix 2.5. On line 254 in file templates\ts_easterlin\html\com_k2\templates\default\category.php I changed
if(count($this->pagination->getPagesLinks())):
to
if($this->pagination->getPagesLinks()):
and now the page loads.