From 140f2f88c87fb85fe844920aeaa458d6614efb25 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 14 Oct 2021 16:17:01 +0800 Subject: [PATCH] * Fix bug#15524. --- module/task/control.php | 4 +--- module/task/js/create.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 043c0f8746..0c39718954 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -85,7 +85,6 @@ class task extends control $execution = $this->execution->getById($executionID); $taskLink = $this->createLink('execution', 'browse', "executionID=$executionID&tab=task"); - $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('execution', 'story', "executionID=$executionID"); /* Set menu. */ $this->execution->setMenu($execution->id); @@ -167,7 +166,7 @@ class task extends control } elseif($this->post->after == 'toStoryList') { - $response['locate'] = $storyLink; + $response['locate'] = $this->createLink('execution', 'story', "executionID=$executionID"); return $this->send($response); } else @@ -280,7 +279,6 @@ class task extends control { $taskLink = $this->createLink('execution', 'browse', "executionID=$executionID"); } - $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('execution', 'story', "executionID=$executionID"); /* Set menu. */ $this->execution->setMenu($execution->id); diff --git a/module/task/js/create.js b/module/task/js/create.js index 18abbea7e1..d72685e7bc 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -178,12 +178,15 @@ function setStoryModule() var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID); $.getJSON(link, function(storyInfo) { - $('#module').val(storyInfo.moduleID); - $("#module").trigger("chosen:updated"); + if(storyInfo) + { + $('#module').val(storyInfo.moduleID); + $("#module").trigger("chosen:updated"); - $('#storyEstimate').val(storyInfo.estimate); - $('#storyPri' ).val(storyInfo.pri); - $('#storyDesc' ).val(storyInfo.spec); + $('#storyEstimate').val(storyInfo.estimate); + $('#storyPri' ).val(storyInfo.pri); + $('#storyDesc' ).val(storyInfo.spec); + } }); } }