From 0789251ea4eb9377bdd9e779765ae480e51fe723 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 10 Jun 2021 08:56:53 +0200 Subject: [PATCH] Handle poll question validation errors for quick replies --- wcfsetup/install/files/js/WCF.Poll.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.Poll.js b/wcfsetup/install/files/js/WCF.Poll.js index 68d0207d1d..290423d6ea 100644 --- a/wcfsetup/install/files/js/WCF.Poll.js +++ b/wcfsetup/install/files/js/WCF.Poll.js @@ -312,6 +312,18 @@ if (COMPILER_TARGET_DEFAULT) { _handleError: function (data) { switch (data.returnValues.fieldName) { + case 'pollQuestion': + var questionField = elById('pollQuestion_' + this._editorId); + var errorMessage = WCF.Language.get('wcf.global.form.error.empty'); + if (data.returnValues.errorType !== 'empty') { + errorMessage = WCF.Language.get('wcf.poll.pollQuestion.error.' + data.returnValues.errorType); + } + + elInnerError(questionField, errorMessage); + + data.cancel = true; + break; + case 'pollEndTime': case 'pollMaxVotes': var fieldName = (data.returnValues.fieldName === 'pollEndTime') ? 'endTime' : 'maxVotes'; -- 2.20.1