Topic: Paging Bug?

Hey I just noticed something odd...

If a topic has 26 posts (page split at 25 posts), only one page is displayed, and the leftover post is missing!   Add one more post and two posts appear on the next page!

Is it a bug?

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

2 (edited by cuteseal 2004-09-06 08:23)

Re: Paging Bug?

Ok more info -- it appears the last poster edited the post.  The number of posts (via sql) is 26, but in the topics table, the topic only shows num_replies = 24.

When I manually changed num_replies to 25, the missing post magically appeared!


Could there be a bug with the post editing bit / updating the topic bit?  *gasp*

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Paging Bug?

It shouldn't happen, that's for sure. I haven't been able to replicate it either. The problem occurs when num_replies is incorrect. The paging code relies on num_replies being correct. I can only speculate as to what causes it in the first place, but my guess is that it happens when something goes wrong with an Apache process and the process is terminated half-way through the posting process. I will look into ways of dealing with it. One way is to actually count the number of posts in a topic instead of just incrementing/decrementing num_replies. More queries, but I guess it's worth it.

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

Re: Paging Bug?

Rickard wrote:

It shouldn't happen, that's for sure. I haven't been able to replicate it either. The problem occurs when num_replies is incorrect. The paging code relies on num_replies being correct. I can only speculate as to what causes it in the first place, but my guess is that it happens when something goes wrong with an Apache process and the process is terminated half-way through the posting process. I will look into ways of dealing with it. One way is to actually count the number of posts in a topic instead of just incrementing/decrementing num_replies. More queries, but I guess it's worth it.

How about using num_replies most of the time, but recount the posts every time you post the first or second post on a page?

Edit: As people can change the "Posts per page"-value, it's maybe not that good idea anyway...

Re: Paging Bug?

Fixed.

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

Re: Paging Bug?

Rickard,

OffTopic something ... when you say "Fixed" does that mean you update the current 1.1.5 download file installation or by fixed you mean it's fixed for 1.2 release version?

Re: Paging Bug?

snapsolutions wrote:

Rickard,

OffTopic something ... when you say "Fixed" does that mean you update the current 1.1.5 download file installation or by fixed you mean it's fixed for 1.2 release version?

It's fixed in 1.2.

Re: Paging Bug?

Thank you smile