Handle all attachments in AttachmentRebuildDataWorker
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 30 Dec 2019 20:46:33 +0000 (21:46 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 30 Dec 2019 20:46:33 +0000 (21:46 +0100)
This ensures that the storage is migrated for non-image attachments.

wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php

index 4c066f66b8b19e5da10060b66b3859cc49219223..0a79ed1b765c0a5ffb6af06eea6bca9c31d1ed4b 100644 (file)
@@ -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) {}
                }