aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authormarcosbc <marcosbc>2014-05-21 00:25:22 +0200
committermarcosbc <marcosbc>2014-05-21 00:52:42 +0200
commitc47c50a29e675a1ba46a0aab42324ad099589682 (patch)
tree97002a92fc4e2cf59efdcd06c9299e01076e2266 /phpBB
parent984ae598bebb63a4b3ffd55dd94334c2b1b30d6f (diff)
downloadforums-c47c50a29e675a1ba46a0aab42324ad099589682.tar
forums-c47c50a29e675a1ba46a0aab42324ad099589682.tar.gz
forums-c47c50a29e675a1ba46a0aab42324ad099589682.tar.bz2
forums-c47c50a29e675a1ba46a0aab42324ad099589682.tar.xz
forums-c47c50a29e675a1ba46a0aab42324ad099589682.zip
[ticket/12270] Fixed tests not working
The success message wasn't output correctly if we were approving topics. PHPBB3-12270
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 74e11e6990..ff230af1e6 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -578,6 +578,7 @@ class mcp_queue
$redirect = reapply_sid($redirect);
$success_msg = $post_url = '';
$approve_log = array();
+ $num_topics = 0;
$s_hidden_fields = build_hidden_fields(array(
'i' => $id,
@@ -634,11 +635,6 @@ class mcp_queue
$phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '', isset($topic_data['first_post']), isset($topic_data['last_post']));
}
- if (sizeof($post_info) >= 1)
- {
- $success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
- }
-
foreach ($approve_log as $log_data)
{
add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_POST_' . strtoupper($action) . 'D', $log_data['post_subject']);
@@ -660,6 +656,7 @@ class mcp_queue
if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
{
$phpbb_notifications->add_notifications(array('topic'), $post_data);
+ $num_topics++;
}
}
else
@@ -705,6 +702,15 @@ class mcp_queue
}
}
+ if ($num_topics >= 1)
+ {
+ $success_msg = ($num_topics == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS';
+ }
+ else
+ {
+ $success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
+ }
+
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
@@ -729,7 +735,6 @@ class mcp_queue
}
else
{
- $num_topics = 0;
$show_notify = false;
if ($action == 'approve')