Fixed import issues
authorMarcel Werk <burntime@woltlab.com>
Sat, 20 Jul 2013 18:34:30 +0000 (20:34 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 20 Jul 2013 18:34:30 +0000 (20:34 +0200)
wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php
wcfsetup/install/files/lib/system/importer/ImportHandler.class.php

index ce9e168cb936bf485f474435094e6fc701117617..5334d54aeebf791a9738ea863ab22a0daf988ccc 100644 (file)
@@ -33,7 +33,7 @@ class AbstractAttachmentImporter implements IImporter {
                if (empty($data['fileHash'])) $data['fileHash'] = sha1_file($additionalData['fileLocation']);
                
                // get user id
-               if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+               $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
                // save attachment
                $action = new AttachmentAction(array(), 'create', array(
index d58786ed65d644bc5895a7e153315b962fb004c9..3e00fee312aa5679dcd7f2bdff236c18adc86f0d 100644 (file)
@@ -29,7 +29,7 @@ class AbstractCommentImporter implements IImporter {
         * @see wcf\system\importer\IImporter::import()
         */
        public function import($oldID, array $data, array $additionalData = array()) {
-               if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+               $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
                $action = new CommentAction(array(), 'create', array(
                        'data' => array_merge($data, array('objectTypeID' => $this->objectTypeID))              
index 7d46815adcbe2a5ee75b890a96a11b3ade857f59..9e78a90ce62661eb6548fb62283c39ab6a7b842a 100644 (file)
@@ -23,7 +23,7 @@ class AbstractCommentResponseImporter implements IImporter {
         * @see wcf\system\importer\IImporter::import()
         */
        public function import($oldID, array $data, array $additionalData = array()) {
-               if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+               $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
                $data['commentID'] = ImportHandler::getInstance()->getNewID($this->objectTypeName, $data['commentID']);
                if (!$data['commentID']) return 0;
index 02c4065ef76aa66b540c309ffe192df3b02c663e..4db00f2616bb91bb4328f4d6980884489a6782f3 100644 (file)
@@ -80,6 +80,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
         * @return      integer         $newID
         */
        public function getNewID($type, $oldID) {
+               if (!$oldID) return null;
                $objectTypeID = $this->objectTypes[$type]->objectTypeID;
                
                if (!isset($this->idMappingCache[$objectTypeID][$oldID])) {