1 (edited by aurore 2006-09-20 00:46)

Topic: when a forum has some "moved" topics, the oldest topics are not shown

hello,

I hope this bug wasn't reported before, I search in that forum but didn't found it.

When a forum has some redirection topics (e.g "Moved: Topic-that-didn't-belong-there") in it, they are not counted in the total number of topic posted in that forum (and that's ok).
Now imagine that you have a forum with 20 topics + one "moved:stuff" topic among it, and that the "Topics per page default" is set to 20 ( a total of 21 "entries")
You should have 2 pages for that forum : The 1st one with 20 entries (19 topics + 1 "moved" topic) and the 2nd one with only one entry: the 20th (the oldest) topic.

But instead there's only one page created, so the oldest topic can't be seen.
And off course, when the "Topics per page default" is set to N, then it happens every (1,2,3...)*N topics. 

Anyway, as it only affects the oldest topic(s) only when a specific number of topics are posted I don't think it's an critical bug wink

(using punbb 1.2.12)

Re: when a forum has some "moved" topics, the oldest topics are not shown

True, nice catch smile

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: when a forum has some "moved" topics, the oldest topics are not shown

Maybe just not count redirect topics in the pagination?

Re: when a forum has some "moved" topics, the oldest topics are not shown

Indeed a nice catch smile

Now, to fix it. Hmm, I really don't want to have to run an additional query to determine the topic+redirect topic count.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: when a forum has some "moved" topics, the oldest topics are not shown

I just noticed this problem on my forum and almost had a heart attack because I thought posts were dropping off / being automatically pruned:  http://punbb.org/forums/viewtopic.php?id=15562

A few follow up questions:

1)  Was a fix applied back in September of 06 but didn't work?
2)  When a new fix is applied will it auto resolve the hidden topics, or will a cleanup script need to be run?
3)  Is there anything I can do in the interim (while waiting for a fix) to show all the topics?

Thanks much!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: when a forum has some "moved" topics, the oldest topics are not shown

1. Looking at the SVN history, it doesn't appear that a fix was applied.
2. It should resolve the issue
3. I can't promise that this will be the fix, but this is the easiest way:
FIND

$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error());

REPLACE WITH

$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error());
http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize