diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 20:21:51 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 23:09:31 -0500 |
commit | 69225bd0a6005e81b7cb58631eb5de7c3d175697 (patch) | |
tree | e60f9bd6d62a959e291e9d60b29c837801e6546b /phpBB/includes/mcp | |
parent | c2c105df9ff1d8fd48afa1d3abdf23a39584d7ed (diff) | |
download | forums-69225bd0a6005e81b7cb58631eb5de7c3d175697.tar forums-69225bd0a6005e81b7cb58631eb5de7c3d175697.tar.gz forums-69225bd0a6005e81b7cb58631eb5de7c3d175697.tar.bz2 forums-69225bd0a6005e81b7cb58631eb5de7c3d175697.tar.xz forums-69225bd0a6005e81b7cb58631eb5de7c3d175697.zip |
[ticket/11162] Use phpbb_update_rows_avoiding_duplicates in mcp.
PHPBB3-11162
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 7 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index b70601b479..913c55a9d1 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -415,12 +415,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) $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)); + phpbb_update_rows_avoiding_duplicates($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 . '&t=' . $to_topic_id) . '">', '</a>'); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 7d4edaf362..f40a4bc044 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -620,12 +620,7 @@ function merge_posts($topic_id, $to_topic_id) else { // 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 topic_id = ' . (int) $topic_id); - $db->sql_return_on_error(false); - - $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id); + phpbb_update_rows_avoiding_duplicates($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id); } // Link to the new topic |