return;
}
+ $objectID = $attachmentHandler->getObjectID();
+ $tmpHash = $attachmentHandler->getTmpHashes()[0] ?? '';
+ if ($objectID > 0) {
+ $tmpHash = '';
+ }
+
AttachmentEditor::fastCreate([
'objectTypeID' => $attachmentHandler->getObjectType()->objectTypeID,
- 'objectID' => $attachmentHandler->getObjectID(),
- 'tmpHash' => $attachmentHandler->getTmpHashes()[0] ?? '',
+ 'objectID' => $objectID,
+ 'tmpHash' => $tmpHash,
'fileID' => $file->fileID,
'userID' => WCF::getUser()->userID ?: null,
'uploadTime' => \TIME_NOW,
public readonly int $parentObjectID,
public readonly string $tmpHash,
- ) {
- }
+ ) {}
}