From a50907250e487675baf9ac77be564b6ccb72b056 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Thu, 13 Dec 2012 20:42:10 -0600 Subject: [ticket/8610] Use phpbb_update_rows_avoiding_duplicates PHPBB3-8610 --- phpBB/includes/mcp/mcp_topic.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'phpBB/includes/mcp/mcp_topic.php') diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index ba11b04884..29d7a0e41b 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -671,17 +671,7 @@ function merge_posts($topic_id, $to_topic_id) $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id); // If the topic no longer exist, we will update the bookmarks table. - // To not let it error out on users who bookmarked both topics, we just return on an error... - $db->sql_return_on_error(true); - $sql = 'UPDATE ' . BOOKMARKS_TABLE . ' - SET topic_id = ' . (int) $to_topic_id . ' - WHERE topic_id = ' . (int) $topic_id; - $db->sql_query($sql); - $db->sql_return_on_error(false); - - $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . ' - WHERE topic_id = ' . (int) $topic_id; - $db->sql_query($sql); + phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_id, $to_topic_id); } // Link to the new topic -- cgit v1.2.1