From: Cyperghost Date: Thu, 4 Jul 2024 07:45:07 +0000 (+0200) Subject: Fixed a bug still accessing the old `_data` field X-Git-Tag: 6.1.0_Alpha_1~41^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b081e0d57d4fe5727296eff8c5fd065513a3f88;p=GitHub%2FWoltLab%2FWCF.git Fixed a bug still accessing the old `_data` field --- 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 + "'"); }