Fixed a bug still accessing the old `_data` field
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 4 Jul 2024 07:45:07 +0000 (09:45 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 4 Jul 2024 07:45:07 +0000 (09:45 +0200)
ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js

index 916d84b0bceff496fa47d89d57055310c7f46bd1..bcd7f630cd6917071f9b4df27dc2912dfd0ba9c7 100644 (file)
@@ -18,7 +18,7 @@ import {
 import { clearPreviousErrors } from "WoltLabSuite/Core/Component/File/Upload";
 
 type FileId = string;
-const fileProcessors = new Map<FieldId, FileProcessor>();
+const fileProcessors = new Map<FileId, FileProcessor>();
 
 export interface ExtraButton {
   title: string;
@@ -67,7 +67,7 @@ export class FileProcessor {
       this.#registerFile(element, element.parentElement);
     });
 
-    _data.set(fieldId, this);
+    fileProcessors.set(fieldId, this);
   }
 
   get classPrefix(): string {
@@ -315,7 +315,7 @@ export class FileProcessor {
 }
 
 export function getValues(fieldId: string): undefined | number | Set<number> {
-  const field = _data.get(fieldId);
+  const field = fileProcessors.get(fieldId);
   if (field === undefined) {
     throw new Error("Unknown field with id '" + fieldId + "'");
   }
index 3b9c31eb20c1009a21a7268354cb9be6c10bfdf0..a93e4a58fddde0c31dd96d4772f69bc074b87d2f 100644 (file)
@@ -9,7 +9,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.getValues = exports.FileProcessor = void 0;
     Listener_1 = tslib_1.__importDefault(Listener_1);
-    const _data = new Map();
+    const fileProcessors = new Map();
     class FileProcessor {
         #container;
         #uploadButton;
@@ -40,7 +40,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui
             this.#container.querySelectorAll("woltlab-core-file").forEach((element) => {
                 this.#registerFile(element, element.parentElement);
             });
-            _data.set(fieldId, this);
+            fileProcessors.set(fieldId, this);
         }
         get classPrefix() {
             return this.showBigPreview ? "fileUpload__preview__" : "fileList__";
@@ -250,7 +250,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui
     }
     exports.FileProcessor = FileProcessor;
     function getValues(fieldId) {
-        const field = _data.get(fieldId);
+        const field = fileProcessors.get(fieldId);
         if (field === undefined) {
             throw new Error("Unknown field with id '" + fieldId + "'");
         }