From: Tim Düsterhus Date: Mon, 30 Dec 2019 20:46:33 +0000 (+0100) Subject: Handle all attachments in AttachmentRebuildDataWorker X-Git-Tag: 5.2.1~32 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9da38bc84d0080b5357296ef255ad3f4b48c040f;p=GitHub%2FWoltLab%2FWCF.git Handle all attachments in AttachmentRebuildDataWorker This ensures that the storage is migrated for non-image attachments. --- diff --git a/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php index 4c066f66b8..0a79ed1b76 100644 --- a/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php @@ -32,7 +32,6 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker { parent::initObjectList(); $this->objectList->sqlOrderBy = 'attachment.attachmentID'; - $this->objectList->getConditionBuilder()->add('attachment.isImage = ?', [1]); } /** @@ -41,11 +40,12 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker { public function execute() { parent::execute(); + /** @var \wcf\data\attachment\Attachment $attachment */ foreach ($this->objectList as $attachment) { + $attachment->migrateStorage(); try { $action = new AttachmentAction([$attachment], 'generateThumbnails'); $action->executeAction(); - $attachment->migrateStorage(); } catch (SystemException $e) {} }