aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-12-13 20:43:31 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-13 20:46:25 -0600
commit2469225a721cfa49528a00dd8cae075de726277f (patch)
treebeeb297044b5fccaa3f701e64e0f9ec731ae95f2 /phpBB/includes/mcp
parenta50907250e487675baf9ac77be564b6ccb72b056 (diff)
parentf4df152b4b88d2c7e2866cc829059781d2aea437 (diff)
downloadforums-2469225a721cfa49528a00dd8cae075de726277f.tar
forums-2469225a721cfa49528a00dd8cae075de726277f.tar.gz
forums-2469225a721cfa49528a00dd8cae075de726277f.tar.bz2
forums-2469225a721cfa49528a00dd8cae075de726277f.tar.xz
forums-2469225a721cfa49528a00dd8cae075de726277f.zip
Merge branch 'develop-olympus' of github.com:phpbb/phpbb3 into ticket/8610
# By Oleg Pudeyev (29) and others # Via Andreas Fischer (3) and others * 'develop-olympus' of github.com:phpbb/phpbb3: (36 commits) [ticket/11262] Add .lock in cache directory to .gitignore [ticket/11265] Add assertions for board installation success. [ticket/11162] Reformat. [ticket/10491] Make recreate_database static. [ticket/11162] Rename tricky updates to database helper. [ticket/10491] Install board once per test run. [ticket/10972] Drop user deletion. [ticket/10972] Tweak user addition. [ticket/10972] Add destroy method to mock cache. [ticket/10972] Add mock null cache. [ticket/10972] Backport get_db from develop. [ticket/10972] Added explicit checks for creating duplicate users. [ticket/10972] Moved tests into appropriate places and added comments [ticket/10972] Added methods for creating and deleting basic users [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. ... Conflicts: phpBB/includes/mcp/mcp_topic.php
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php16
-rw-r--r--phpBB/includes/mcp/mcp_topic.php12
2 files changed, 12 insertions, 16 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 097f67487d..de2966d34e 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -414,19 +414,15 @@ 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);
+ if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status'))
+ {
+ include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
+ }
- $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
+ // Update the topic watch table.
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id);
// If the topic no longer exist, we will update the bookmarks table.
- if (!function_exists('phpbb_update_rows_avoiding_duplicates'))
- {
- include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
- }
phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_ids, $to_topic_id);
// Link to the new topic
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 29d7a0e41b..76985488b7 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -662,13 +662,13 @@ 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);
+ if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status'))
+ {
+ include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
+ }
- $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id);
+ // If the topic no longer exist, we will update the topic watch table.
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id);
// If the topic no longer exist, we will update the bookmarks table.
phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_id, $to_topic_id);