From e04f9a2425a59e3ef20bc2e962ee09b2b22c7f8d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 30 May 2015 12:27:00 +0200 Subject: [PATCH] [ticket/9252] Do not try to disapprove a post that was just approved Without this change, posts that are approved by someone right before another moderator is trying to disapprove a post are actually deleted instead of disapproved. PHPBB3-9252 --- phpBB/includes/mcp/mcp_queue.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 82c3bc9ab0..99f0d7155f 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -1130,6 +1130,11 @@ class mcp_queue // Build a list of posts to be disapproved and get the related topics real replies count foreach ($post_info as $post_id => $post_data) { + if ($mode === 'unapproved_topics' && $post_data['post_visibility'] == ITEM_APPROVED) + { + continue; + } + $post_disapprove_list[$post_id] = $post_data['topic_id']; if (!isset($topic_posts_unapproved[$post_data['topic_id']])) { @@ -1139,6 +1144,12 @@ class mcp_queue $topic_posts_unapproved[$post_data['topic_id']]++; } + // Do not try to disapprove if no posts are selected + if (empty($post_disapprove_list)) + { + trigger_error('NO_POST_SELECTED'); + } + // Now we build the log array foreach ($post_disapprove_list as $post_id => $topic_id) {