Fix issue when creating an article with attachments in the admin panel
authorMarcel Werk <burntime@woltlab.com>
Fri, 10 Nov 2023 15:56:21 +0000 (16:56 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 10 Nov 2023 15:56:21 +0000 (16:56 +0100)
wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php

index 948274a98466e08407cd6c648afc57dad53f91e9..5f46149f40911e0b504f771fc7bb55b1d4b2ce79 100644 (file)
@@ -574,6 +574,13 @@ class ArticleAddForm extends AbstractForm
         $this->title = $this->teaser = $this->content = $this->images = $this->imageID = $this->teaserImages = $this->teaserImageID == $this->tags = [];
         $this->metaTitle = $this->metaDescription = [];
 
+        // Reload attachment handler to reset the uploaded attachments.
+        $this->attachmentHandler = new AttachmentHandler(
+            $this->attachmentObjectType,
+            $this->attachmentObjectID,
+            $this->tmpHash
+        );
+
         $this->setDefaultValues();
     }