From 22370a74ecd10c02668348f427021cabfaf5bc7c Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 3 Dec 2020 09:16:45 +0800 Subject: [PATCH] * Fix bug #3697. --- module/bug/control.php | 1 + module/bug/js/create.js | 2 +- module/bug/view/create.html.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index 1cee24c46b..ba3704f287 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -484,6 +484,7 @@ class bug extends control $this->view->branches = $branches; $this->view->color = $color; $this->view->stepsRequired = strpos($this->config->bug->create->requiredFields, 'steps'); + $this->view->isStepsTemplate = $steps == $this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect ? true : false; $this->display(); } diff --git a/module/bug/js/create.js b/module/bug/js/create.js index a13c2fa705..1d57229bce 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -125,7 +125,7 @@ $(function() $('#submit').on('click', function() { var steps = editor['steps'].html(); - if(stepsRequired !== false && (steps == stepsTemplate || steps == editor.steps.templateHtml)) + if(stepsRequired !== false && (steps == stepsTemplate || steps == editor.steps.templateHtml) && isStepsTemplate) { bootbox.alert(stepsNotEmpty); return false; diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 7b76e84b72..bf21fc80a9 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -22,6 +22,7 @@ js::set('refresh', $lang->refresh); js::set('flow', $config->global->flow); js::set('stepsRequired', $stepsRequired); js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty); +js::set('isStepsTemplate', $isStepsTemplate); ?>