Process deletions before uploads in StyleAddForm
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 21 Jul 2020 10:04:34 +0000 (12:04 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 21 Jul 2020 13:34:40 +0000 (15:34 +0200)
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php

index 424489e5e25758d8a4180fa2d105471e295f545b..b6a550bf9d31a99b4b7eb15878dbdb42b60f7fb1 100644 (file)
@@ -323,14 +323,15 @@ class StyleAddForm extends AbstractForm {
                
                $this->uploads = [];
                foreach (['image', 'image2x'] as $field) {
-                       $files = UploadHandler::getInstance()->getFilesByFieldId($field);
-                       if (!empty($files)) {
-                               $this->uploads[$field] = $files[0];
-                       }
                        $removedFiles = UploadHandler::getInstance()->getRemovedFiledByFieldId($field);
                        if (!empty($removedFiles)) {
                                $this->uploads[$field] = null;
                        }
+                       
+                       $files = UploadHandler::getInstance()->getFilesByFieldId($field);
+                       if (!empty($files)) {
+                               $this->uploads[$field] = $files[0];
+                       }
                }
        }