aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-19 14:37:06 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-19 14:37:06 +0200
commit326ba5325b1185389f22856a999246aec77fc8c7 (patch)
tree2c4f8f36a8756ced0fb17b496735ea9965a78c0b /phpBB/includes/mcp
parentb17fc9804391760e369eda7893ccba2b522ddef8 (diff)
parentdfd5ec6835f7cd4dd9a248c8a55da35c2032d98c (diff)
downloadforums-326ba5325b1185389f22856a999246aec77fc8c7.tar
forums-326ba5325b1185389f22856a999246aec77fc8c7.tar.gz
forums-326ba5325b1185389f22856a999246aec77fc8c7.tar.bz2
forums-326ba5325b1185389f22856a999246aec77fc8c7.tar.xz
forums-326ba5325b1185389f22856a999246aec77fc8c7.zip
Merge branch '3.1.x'
* 3.1.x: [ticket/9252] Do not try to disapprove a post that was just approved
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 132786818b..cb4b590196 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -1148,6 +1148,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']]))
{
@@ -1157,6 +1162,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)
{