Fixed import issues
authorMarcel Werk <burntime@woltlab.com>
Thu, 4 Jul 2013 00:26:55 +0000 (02:26 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 4 Jul 2013 00:26:55 +0000 (02:26 +0200)
files/lib/system/importer/ConversationUserImporter.class.php

index 7d5742baf7ab2cbad47d760336c5c1eebb319b2d..72cf72c64c3333afcb62a053491c01fa841257de 100644 (file)
@@ -23,9 +23,9 @@ class ConversationUserImporter implements IImporter {
                if (!$data['conversationID']) return 0;
                $data['participantID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['participantID']);
                
-               $sql = "INSERT INTO             wcf".WCF_N."_conversation_to_user
-                                               (conversationID, participantID, hideConversation, isInvisible, lastVisitTime)
-                       VALUES                  (?, ?, ?)";
+               $sql = "INSERT IGNORE INTO              wcf".WCF_N."_conversation_to_user
+                                                       (conversationID, participantID, hideConversation, isInvisible, lastVisitTime)
+                       VALUES                          (?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array(
                        $data['conversationID'],
@@ -37,11 +37,11 @@ class ConversationUserImporter implements IImporter {
                
                // save labels
                if ($data['participantID'] && !empty($data['labelIDs'])) {
-                       $sql = "INSERT INTO             wcf".WCF_N."_conversation_label_to_object
-                                                       (labelID, conversationID)
-                               VALUES                  (?, ?)";
+                       $sql = "INSERT IGNORE INTO              wcf".WCF_N."_conversation_label_to_object
+                                                               (labelID, conversationID)
+                               VALUES                          (?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       foreach ($data['labelIDs'] as $labelIDs) {
+                       foreach ($data['labelIDs'] as $labelID) {
                                $labelID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation.label', $labelID);
                                if ($labelID) $statement->execute(array($labelID, $data['conversationID']));
                        }