From 1af3931a4833f8a3073d882888b0d4c2e08a8fb4 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Tue, 21 May 2024 16:19:12 -0400 Subject: [PATCH] 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 --- inc/mod/pages.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index f57419ba..4a8d392e 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -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