mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/8610] Update Bookmarks when merging posts into another topic
Update bookmarks to the new topic when merging posts into another topic using the merge_posts function. PHPBB3-8610
This commit is contained in:
parent
8dd2a151cc
commit
05d7decdd3
1 changed files with 9 additions and 1 deletions
|
@ -626,6 +626,14 @@ function merge_posts($topic_id, $to_topic_id)
|
||||||
$db->sql_return_on_error(false);
|
$db->sql_return_on_error(false);
|
||||||
|
|
||||||
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $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);
|
||||||
|
$db->sql_query('UPDATE ' . BOOKMARKS_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 ' . BOOKMARKS_TABLE . ' WHERE topic_id = ' . (int) $topic_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link to the new topic
|
// Link to the new topic
|
||||||
|
|
Loading…
Add table
Reference in a new issue