From 56cda38f8dfde824f514db6b557230ae4bb17c1d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 23 Jan 2024 14:44:28 +0800 Subject: [PATCH] * Fix bug #44801. --- module/task/model.php | 10 ++++++---- module/task/zen.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 4471de93bf..ccf577addb 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1050,15 +1050,17 @@ class taskModel extends model $this->loadModel('action'); /* Get the stories of the test tasks. */ - $testStoryIdList = array_keys($testTasks); - $testStories = $this->dao->select('id,title,version,module')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchAll('id'); - foreach($testStoryIdList as $storyID) + $testStoryIdList = array(); + foreach($testTasks as $task) $testStoryIdList[$task->story] = $task->story; + + $testStories = $this->dao->select('id,title,version,module')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchAll('id'); + foreach($testTasks as $task) { /* If the story id is not exist, skip it. */ + $storyID = $task->story; if(!isset($testStories[$storyID])) continue; /* Construct a task and create it. */ - $task = $testTasks[$storyID]; $task->parent = $taskID; $task->storyVersion = $testStories[$storyID]->version; $task->name = $this->lang->task->lblTestStory . " #{$storyID} " . $testStories[$storyID]->title; diff --git a/module/task/zen.php b/module/task/zen.php index 74d1a38cb3..d32289f148 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -727,7 +727,7 @@ class taskZen extends task $task->vision = $this->config->vision; $task->project = $execution->project; - $testTasks[$storyID] = $task; + $testTasks[] = $task; } $this->checkCreateTestTasks($testTasks);