Keyword

Error Message after upgrade to php8.0-fpm

  • Alfons Flatscher
  • Alfons Flatscher's Avatar Topic Author
  • Offline
  • New Member
More
1 week 5 days ago #178576 by Alfons Flatscher
Error Message after upgrade to php8.0-fpm was created by Alfons Flatscher
We use K2 for our joomla website. After upgrading to php8.0-fpm (we run on nginx) we encountered issues. Whenever we open a K2-Item the following error message appears:
> 0 count(): Argument #1 ($var) must be of type Countable|array, null given
> It appears the page you were looking for doesn't exist. Sorry about that.

When opening other post created for examle with easyblog they display just fine.
Any ideas?

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 5 days ago #178585 by Fotis
Replied by Fotis on topic Error Message after upgrade to php8.0-fpm
This is most likely an outdated K2 template override. Switch error reporting in Joomla's Global Configuration to maximum to see the exact file and line that this error occurs in.

In most cases it's just a matter of checking if an array is set before counting its items.

So if you have something like:
if (count($items)) {
    // do something, e.g. run a "foreach" loop
}

change it to:
if (isset($items) && count($items)) {
    // do something, e.g. run a "foreach" loop
}

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum