From: Marcel Werk Date: Wed, 9 Oct 2013 12:00:37 +0000 (+0200) Subject: Fixed attachment import issue X-Git-Tag: 2.0.0_Beta_11~49^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e40f4d2f176597ffa77bda7afc223ea33170b7e1;p=GitHub%2FWoltLab%2FWCF.git Fixed attachment import issue --- diff --git a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php index eb7f53f5c8..c11a5e2778 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php @@ -1,6 +1,7 @@ getNewID('com.woltlab.wcf.user', $data['userID']); + // check existing attachment id + if (is_numeric($oldID)) { + $attachment = new Attachment($oldID); + if (!$attachment->attachmentID) $data['attachmentID'] = $oldID; + } + // save attachment $attachment = AttachmentEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));