Don't forget to rebuild the themes on origin board when moving

- if you're moving a post to a different board it would only
  rebuildThemes of the target board
This commit is contained in:
towards-a-new-leftypol 2024-05-21 16:19:12 -04:00
parent bdd813cd77
commit 1af3931a48
1 changed files with 3 additions and 3 deletions

View File

@ -1562,7 +1562,7 @@ function mod_merge($originBoard, $postID) {
}
}
if ($targetBoard === $originBoard){
if ($targetBoard === $originBoard) {
// Just update the thread id for all posts in the original thread to new op
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `thread` = :newthread WHERE `id` = :oldthread OR `thread` = :oldthread', $originBoard));
$query->bindValue(':newthread', $targetOp, PDO::PARAM_INT);
@ -1586,8 +1586,7 @@ function mod_merge($originBoard, $postID) {
// redirect
header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . link_for($newpost) . '#' . $targetOp, true, $config['redirect_http']);
}
else {
} else {
// Move thread to new board without shadow thread and then update the thread id for all posts in that thread to new op
// indicate that the post is a thread
if (count($boards) <= 1)
@ -1726,6 +1725,7 @@ function mod_merge($originBoard, $postID) {
deletePost($postID);
modLog("Deleted post #{$postID}");
buildIndex();
rebuildThemes('post', $originBoard);
openBoard($targetBoard);
// Just update the thread id for all posts in the original thread to new op