From 1c402870999188882415f09e66b3ab30b76bc26d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 13 Feb 2014 22:36:17 +0100 Subject: [PATCH] Fix AbstractCommentResponseImporter see #1500 --- .../AbstractCommentResponseImporter.class.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php index 981028815f..c4fdf6ee1d 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php @@ -6,8 +6,8 @@ use wcf\system\WCF; /** * Imports comment responses. * - * @author Marcel Werk - * @copyright 2001-2013 WoltLab GmbH + * @author Tim Duesterhus, Marcel Werk + * @copyright 2001-2014 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.importer @@ -36,13 +36,23 @@ class AbstractCommentResponseImporter extends AbstractImporter { $response = CommentResponseEditor::create($data); + $sql = "SELECT responseID + FROM wcf".WCF_N."_comment_response + WHERE commentID = ? + ORDER BY responseID ASC"; + $statement = WCF::getDB()->prepareStatement($sql, 3); + $statement->execute(array($response->commentID)); + $responseIDs = array(); + while ($responseID = $statement->fetchColumn()) $responseIDs[] = $responseID; + // update parent comment $sql = "UPDATE wcf".WCF_N."_comment - SET responseIDs = ? + SET responseIDs = ?, + responses = responses + 1 WHERE commentID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array( - serialize(array($response->responseID)), + serialize($responseIDs), $response->commentID )); -- 2.20.1