From: Marcel Werk Date: Sat, 20 Jul 2013 18:34:30 +0000 (+0200) Subject: Fixed import issues X-Git-Tag: 2.0.0_Beta_5~31 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=732a49db58b8460885e915fb7ee7b5696b380edb;p=GitHub%2FWoltLab%2FWCF.git Fixed import issues --- diff --git a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php index ce9e168cb9..5334d54aee 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php @@ -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( diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php index d58786ed65..3e00fee312 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php @@ -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)) diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php index 7d46815adc..9e78a90ce6 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php index 02c4065ef7..4db00f2616 100644 --- a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php +++ b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php @@ -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])) {