Fix JS for upload form fields
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 1 Jan 2021 12:16:27 +0000 (13:16 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Fri, 1 Jan 2021 14:35:41 +0000 (15:35 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/File/Upload.ts

index 97f1a129ee77c1458770a1bbd901baae67d231cd..3038ca1c873cb8650c05d645f2744e36ed1ad389 100644 (file)
@@ -26,6 +26,10 @@ define(["require", "exports", "tslib", "../../Core", "./Delete", "../../Dom/Util
                 imagePreview: false,
                 // max files
                 maxFiles: null,
+                // Dummy value, because it is checked in the base method, without using it with this upload handler.
+                className: "invalid",
+                // url
+                url: `index.php?ajax-file-upload/&t=${window.SECURITY_TOKEN}`,
             }, options);
             options.multiple = options.maxFiles === null || options.maxFiles > 1;
             super(buttonContainerId, targetId, options);
index d8ab9f7d045931213fec585300ef86403f0b6801..24cb0b17eaf0bf02563108b2c9ad594b11e7ca33 100644 (file)
@@ -59,6 +59,10 @@ class FileUpload extends Upload<FileUploadOptions> implements FileUploadHandler
         imagePreview: false,
         // max files
         maxFiles: null,
+        // Dummy value, because it is checked in the base method, without using it with this upload handler.
+        className: "invalid",
+        // url
+        url: `index.php?ajax-file-upload/&t=${window.SECURITY_TOKEN}`,
       },
       options,
     );