From 5b081e0d57d4fe5727296eff8c5fd065513a3f88 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 4 Jul 2024 09:45:07 +0200 Subject: [PATCH] Fixed a bug still accessing the old `_data` field --- .../Core/Form/Builder/Field/Controller/FileProcessor.ts | 6 +++--- .../Core/Form/Builder/Field/Controller/FileProcessor.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts index 916d84b0bc..bcd7f630cd 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts @@ -18,7 +18,7 @@ import { import { clearPreviousErrors } from "WoltLabSuite/Core/Component/File/Upload"; type FileId = string; -const fileProcessors = new Map(); +const fileProcessors = new Map(); 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 { - const field = _data.get(fieldId); + const field = fileProcessors.get(fieldId); if (field === undefined) { throw new Error("Unknown field with id '" + fieldId + "'"); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js index 3b9c31eb20..a93e4a58fd 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js @@ -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 + "'"); } -- 2.20.1