MyBB Community Forums

Full Version: [F] Delete unapproved posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you delete an unapproved post the thread and forum counters don't get updated properly. The number in brackets that shows the number of unapproved posts doesn't change.

Fix: Open inc/class_moderation.php and search for:
		// Update stats
		$update_array = array(
			"replies" => "-{$num_approved_posts}",
			"unapprovedposts" => "-{$num_unapproved_posts}"
		);
		update_thread_counters($post['tid'], $update_array);


		// Update stats
		$update_array = array(
			"posts" => "-{$num_approved_posts}",
			"unapprovedposts" => "-{$num_unapproved_posts}"
		);
Replace with:
		// Update stats
		$update_array = array(
			"replies" => "-{$num_approved_posts}",
			"unapprovedposts" => $num_unapproved_posts
		);
		update_thread_counters($post['tid'], $update_array);


		// Update stats
		$update_array = array(
			"posts" => "-{$num_approved_posts}",
			"unapprovedposts" => $num_unapproved_posts
		);
I could be wrong, but I think this is the actual fix:

Find:
--$num_unaproved_posts;
Replace with:
++$num_unapproved_posts;

(Corrects misspelling, and makes it a positive number because a minus sign is prepended later)
Well, the result is the same. Toungue
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.