From bd194337768a788aed013794f5e27d9b0b6ae98f Mon Sep 17 00:00:00 2001 From: jove Date: Mon, 22 Aug 2016 18:57:50 +0100 Subject: [PATCH] Fixes two bugs preventing replies from being moved. --- inc/mod/pages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 47970b14..955e48b5 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1245,8 +1245,9 @@ function mod_move_reply($originBoard, $postID) { // build index buildIndex(); + // build new thread - buildThread($newID); + buildThread($post['op'] ? $newID : $post['thread']); // trigger themes rebuildThemes('post', $targetBoard); @@ -1264,7 +1265,7 @@ function mod_move_reply($originBoard, $postID) { openBoard($targetBoard); // Find new thread on our target board - $query = prepare(sprintf('SELECT thread FROM ``posts_%s`` WHERE `id` = :id', $targetBoard)); + $query = prepare(sprintf('SELECT thread, id FROM ``posts_%s`` WHERE `id` = :id', $targetBoard)); $query->bindValue(':id', $newID); $query->execute() or error(db_error($query)); $post = $query->fetch(PDO::FETCH_ASSOC);