Skip to:
Content

bbPress.org

Opened 9 years ago

Last modified 8 years ago

#1323 new defect

Topic counts are off when posts are spammed and deleted

Reported by: mrmist 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.

Change History (3)

#1 @mrmist
9 years ago

  • Version changed from 1.0.1 to 1.1-alpha

#2 @GautamGupta
9 years ago

  • Milestone set to 1.1

#3 @johnjamesjacoby
8 years ago

  • Milestone changed from 1.1 to 1.2
Note: See TracTickets for help on using tickets.