Fixed empty 'lastDownloadTime' after importing
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 May 2016 12:12:58 +0000 (14:12 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 23 May 2016 12:12:58 +0000 (14:12 +0200)
wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php

index 61701ee535f708eae664031a683d7da4c6a896c4..ff37c42fcdbd6596c209c27506aca08070650aef 100644 (file)
@@ -54,6 +54,11 @@ class AbstractAttachmentImporter extends AbstractImporter {
                        if (!$attachment->attachmentID) $data['attachmentID'] = $oldID;
                }
                
+               // set default last download time
+               if (empty($data['lastDownloadTime']) && !empty($data['downloads'])) {
+                       $data['lastDownloadTime'] = TIME_NOW;
+               }
+               
                // save attachment
                $attachment = AttachmentEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));