From 9da38bc84d0080b5357296ef255ad3f4b48c040f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 30 Dec 2019 21:46:33 +0100 Subject: [PATCH] Handle all attachments in AttachmentRebuildDataWorker This ensures that the storage is migrated for non-image attachments. --- .../lib/system/worker/AttachmentRebuildDataWorker.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {} } -- 2.20.1