Merge pull request #3666 from marc1706/ticket/9252

[ticket/9252] Do not try to disapprove a post that was just approved

* marc1706/ticket/9252:
  [ticket/9252] Do not try to disapprove a post that was just approved
This commit is contained in:
Tristan Darricau 2015-10-19 14:36:51 +02:00
commit dfd5ec6835

View file

@ -1131,6 +1131,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']]))
{
@ -1140,6 +1145,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)
{