diff --git a/module/testtask/ui/create.html.php b/module/testtask/ui/create.html.php
index c65fa7574f..1910e64fe8 100644
--- a/module/testtask/ui/create.html.php
+++ b/module/testtask/ui/create.html.php
@@ -29,7 +29,7 @@ formPanel
set::control('picker'),
set::items($products)
),
- $noMultipleExecutionID ? input
+ isset($noMultipleExecutionID) ? input
(
set::type('hidden'),
set::name('execution'),
diff --git a/module/testtask/zen.php b/module/testtask/zen.php
index 2f7afea727..94fb36d1d6 100644
--- a/module/testtask/zen.php
+++ b/module/testtask/zen.php
@@ -316,6 +316,14 @@ class testtaskZen extends testtask
if(!empty($execution) && $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution);
}
+ /* 如果测试单所属产品在产品键值对中不存在,将其加入。*/
+ /* Prepare the product key-value pairs. */
+ if(!isset($this->products[$productID]))
+ {
+ $product = $this->loadModel('product')->getByID($productID);
+ $this->products[$productID] = $product->name;
+ }
+
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
$this->view->product = $this->loadModel('product')->getByID($productID);
$this->view->executions = $productID ? $this->product->getExecutionPairsByProduct($productID, '', $projectID, 'stagefilter') : array();