Opened 15 years ago
Last modified 13 years ago
#1323 new defect (bug)
Topic counts are off when posts are spammed and deleted
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release (Legacy) | Priority: | normal |
Severity: | normal | Version: | 1.1-alpha |
Component: | General - Administration | Keywords: | |
Cc: |
Description
Steps to reproduce -
Create a sub-forum
Post in the forum
Spam the post (or post the topic as a bozo)
Delete the topic
Topic count will decrease by 1, even though the spammed topic wasn't included in the count.
If I had to guess I'd point to this as the culprit in bb_delete_post
if ( 0 == $old_status ) {
bb_update_topicmeta( $topic_id, 'deleted_posts',
$topic->deleted_posts + 1 );
$bbdb->query( $bbdb->prepare( "UPDATE
$bbdb->forums SET posts = posts - 1 WHERE forum_id = %d",
$topic->forum_id ) );
} else if ( 0 == $new_status ) {
bb_update_topicmeta( $topic_id, 'deleted_posts',
$topic->deleted_posts - 1 );
$bbdb->query( $bbdb->prepare( "UPDATE
$bbdb->forums SET posts = posts + 1 WHERE forum_id = %d",
$topic->forum_id ) );
}
Since there's nothing there to handle status 2, for spam.