Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
238 views
in Q2A Core by

Feeds for search results is an administrator option available under `Admin``RSS feeds`. When it is on, and the `Example feed` link next to is clicked, an error page will show up and the following error message will appear in server's error log:

PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in .../qa-include/qa-feed.php:168\nStack trace:\n#0 .../qa-include/qa-index.php(186): require()\n#1 .../index.php(27): require('...')\n#2 {main}\n  thrown in .../qa-include/qa-feed.php on line 168

Here's an animation on how to reproduce this error message:


What should I do to iron it out?

Q2A version: 1.8.5

1 Answer

0 votes
by
 
Best answer

Please substitute this line of code:

$countslugs = $categoryslugs ? count($categoryslugs) : 0;

for this one:

$countslugs = @count($categoryslugs);

on line 168 at qa-include/qa-feed.php

...