aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_forum.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-12-14 02:56:20 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-12-14 02:56:20 +0100
commit6e25b4231e11b8d5a08c5de0b498fb27b8598809 (patch)
tree8eadadddc8ef189498dcf97368e0e10f28bbd2d1 /phpBB/includes/mcp/mcp_forum.php
parentb5142296b182a4bf0d552aac565d90aa0befd07a (diff)
parentf4df152b4b88d2c7e2866cc829059781d2aea437 (diff)
downloadforums-6e25b4231e11b8d5a08c5de0b498fb27b8598809.tar
forums-6e25b4231e11b8d5a08c5de0b498fb27b8598809.tar.gz
forums-6e25b4231e11b8d5a08c5de0b498fb27b8598809.tar.bz2
forums-6e25b4231e11b8d5a08c5de0b498fb27b8598809.tar.xz
forums-6e25b4231e11b8d5a08c5de0b498fb27b8598809.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: (22 commits) [ticket/11162] Reformat. [ticket/11162] Rename tricky updates to database helper. [ticket/11162] Use empty($queries). [ticket/11162] Review comments fixed. [ticket/11162] Reformat. [ticket/11162] Newlines to LF. [ticket/11162] Use correct functions. [ticket/11162] Account for notify_status. [ticket/11162] This test really only works for bookmarks. [ticket/11162] The test is not at all trivial. [ticket/11162] Add includes. [ticket/11162] Move to a separate file to avoid blowing out functions.php. [ticket/11162] No whitespace changes in olympus. [ticket/11162] Fix inaccurately copy pasted comment. [ticket/11162] Use phpbb_update_rows_avoiding_duplicates in mcp. [ticket/11162] Clarify that only the two tables actually work. [ticket/11162] Uncomment transactions. [ticket/11162] An implementation that actually works. [ticket/11162] Make count function upper case. [ticket/11162] Rename count variable name to remaining_rows. ...
Diffstat (limited to 'phpBB/includes/mcp/mcp_forum.php')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 4dd5e5856a..4ef4b75855 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -430,13 +430,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
- // If the topic no longer exist, we will update the topic watch table.
- // To not let it error out on users watching both topics, we just return on an error...
- $db->sql_return_on_error(true);
- $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
- $db->sql_return_on_error(false);
-
- $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
+ // Update the topic watch table.
+ if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status'))
+ {
+ include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
+ }
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id);
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');