From e86d8b97f2d079176bd44a7e9e94d8b95529e70d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 28 May 2022 14:48:22 +0200 Subject: [PATCH] Missing removal of existing error messages See https://www.woltlab.com/community/thread/295622-bitte-f%C3%BCllen-sie-dieses-eingabefeld-aus-doppelt-angezeigt/ --- wcfsetup/install/files/js/WCF.Message.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index 2f82d9c114..105c455590 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -337,6 +337,18 @@ if (COMPILER_TARGET_DEFAULT) { } if ($message.trim().length === 0) { + const innerError = this._textarea[0].parentElement.querySelector(".innerError"); + if (innerError) { + innerError.remove(); + } else { + // Error messages that are present on page load are placed after + // the `.redactor-box` parent. + const sibling = this._textarea[0].parentElement.nextElementSibling; + if (sibling && sibling.classList.contains("innerError")) { + sibling.remove(); + } + } + elInnerError(this._textarea.redactor("core.editor")[0], WCF.Language.get("wcf.global.form.error.empty")); return; } -- 2.20.1