From: Marcel Werk Date: Thu, 4 Jul 2013 13:20:31 +0000 (+0200) Subject: Fixed import issues X-Git-Tag: 2.0.0_Beta_1~24 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=500e939ad21ee73cdc5fc52e21d693bcd58b0522;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.exporter.git Fixed import issues --- diff --git a/files/lib/system/exporter/WBB3xExporter.class.php b/files/lib/system/exporter/WBB3xExporter.class.php index daaeb30..c1507b1 100644 --- a/files/lib/system/exporter/WBB3xExporter.class.php +++ b/files/lib/system/exporter/WBB3xExporter.class.php @@ -689,13 +689,26 @@ class WBB3xExporter extends AbstractExporter { $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute(array(0)); while ($row = $statement->fetchArray()) { - ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation')->import($row['pmID'], array( + $conversationID = ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation')->import($row['pmID'], array( 'subject' => $row['subject'], 'time' => $row['time'], 'userID' => $row['userID'], 'username' => $row['username'], 'isDraft' => $row['isDraft'] )); + + // add author + $sql = "INSERT IGNORE INTO wcf".WCF_N."_conversation_to_user + (conversationID, participantID, hideConversation, isInvisible, lastVisitTime) + VALUES (?, ?, ?, ?, ?)"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array( + $conversationID, + ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $row['userID']), + 0, + 0, + TIME_NOW + )); } } @@ -756,7 +769,7 @@ class WBB3xExporter extends AbstractExporter { FROM wcf".$this->dbNo."_pm_to_user pm_to_user LEFT JOIN wcf".$this->dbNo."_pm pm ON (pm.pmID = pm_to_user.pmID) - ORDER BY pm_to_user.pmID, pm_to_user.recipientID"; + ORDER BY pm_to_user.pmID DESC, pm_to_user.recipientID"; $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute(); while ($row = $statement->fetchArray()) {