Fix issue in conversation export (MyBB)
authorTim Düsterhus <timwolla@bastelstu.be>
Wed, 4 Dec 2013 20:32:55 +0000 (21:32 +0100)
committerTim Düsterhus <timwolla@bastelstu.be>
Wed, 4 Dec 2013 20:33:32 +0000 (21:33 +0100)
files/lib/system/exporter/MyBB16xExporter.class.php

index 2496219559dd171cc80cb842bf16b8ef5ac7290e..90bb520ca17995e50c1b4ed9f26b660123a90ec4 100644 (file)
@@ -634,8 +634,10 @@ class MyBB16xExporter extends AbstractExporter {
         * Exports conversation recipients.
         */
        public function exportConversationUsers($offset, $limit) {
-               $sql = "SELECT          *
-                       FROM            ".$this->databasePrefix."privatemessages
+               $sql = "SELECT          message_table.*, user_table.username
+                       FROM            ".$this->databasePrefix."privatemessages message_table
+                       LEFT JOIN       ".$this->databasePrefix."users user_table
+                       ON              user_table.uid = message_table.uid
                        ORDER BY        pmid ASC";
                $statement = $this->database->prepareStatement($sql, $limit, $offset);
                $statement->execute();
@@ -644,6 +646,7 @@ class MyBB16xExporter extends AbstractExporter {
                        ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.user')->import(0, array(
                                'conversationID' => $row['fromid'].'-'.$row['dateline'],
                                'participantID' => $row['uid'],
+                               'username' => $row['username'] ?: '',
                                'hideConversation' => $row['deletetime'] ? 1 : 0,
                                'isInvisible' => (isset($recipients['bcc']) && in_array($row['uid'], $recipients['bcc'])) ? 1 : 0,
                                'lastVisitTime' => $row['readtime']