Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.5k views
in Q2A Core by
edited by

My unanswered list ist showing a 2nd page but when you go to this page it says "no unanswered questions found". here: http://www.gute-mathe-fragen.de/unanswered

Is this a "bug"?

by
Weird. If you click 'Recount posts' under the 'Stats' section of the admin panel, does that fix it?
by
edited by
did so, nope, still the same: "2" in pagination.

I mean, this "problem" is not severe. I can ignore it :)

PS: Could it be hidden questions? wait... I think I modded the qa-db-selects.php # see here: http://question2answer.org/qa/15799/why-closed-question-still-appear-unanswered-question-list

so that it hides closed questions, may this be the cause?

1 Answer

0 votes
by
selected by
 
Best answer
Did you change the database query for detecting unanswered questions in some way? That would explain the discrepancy between the cached unanswered count, which determines pagination, and the questions that are actually retrieved.
by
nope, I did not change the queries. Just qa_db_unanswered_qs_selectspec() in qa-db-selects.php, adding "AND closedbyid IS NULL": $bysql='acount=0 AND closedbyid IS NULL';

as described here: http://question2answer.org/qa/15799/why-closed-question-still-appear-unanswered-question-list
by
That counts as changing the queries :) It's the cause of your problem. You need to adjust qa_db_unaqcount_update() in qa-db-post-create.php to match the new login you added to the retrieval query.
by
"That counts as changing the queries :)"
=) yep u r r8

I would love to see an option in the admin to "hide closed questions" for v1.5.3 :)
by
Alright, I did what you suggested:

In qa-db-post-create.php I changed line 333 from:
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND acount=0");

to:
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND acount=0 AND closedbyid IS NULL");

Then I clicked >Admin >Stats >Recount Posts. Now the pagination is correct.

I only hope that this is not causing any other statistics / routines to break or count false...
...