From: Matthias Schmidt Date: Thu, 10 Jun 2021 06:56:53 +0000 (+0200) Subject: Handle poll question validation errors for quick replies X-Git-Tag: 5.3.8~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0789251ea4eb9377bdd9e779765ae480e51fe723;p=GitHub%2FWoltLab%2FWCF.git Handle poll question validation errors for quick replies --- 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';