From ed2efc053ca15562f3804e9d0fd9b0f01bfb8cbe Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 2 Dec 2021 14:05:35 +0800 Subject: [PATCH] * Fix bug #16975. --- module/testcase/control.php | 5 +++-- module/testcase/view/showimport.html.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 2cfd24f23f..9817b145cc 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1838,7 +1838,8 @@ class testcase extends control $caseLang = $this->lang->testcase; $caseConfig = $this->config->testcase; - $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch); + $branches = $this->loadModel('branch')->getPairs($productID); + $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, empty(array_keys($branches)) ? 0 : array_keys($branches)); $stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); $fields = $this->testcase->getImportFields($productID); $fields = array_flip($fields); @@ -2019,7 +2020,7 @@ class testcase extends control $this->view->caseData = $caseData; $this->view->stepData = $stepData; $this->view->productID = $productID; - $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->branches = $branches; $this->view->isEndPage = $pagerID >= $allPager; $this->view->allCount = $allCount; $this->view->allPager = $allPager; diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index 0b6cbc545a..79c721e73e 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -81,7 +81,8 @@ $(function() title, ENT_QUOTES), "class='form-control'")?> - module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange'")?> + branch) and $case->branch != 0) ? $modules[BRANCH_MAIN] + $modules[$case->branch] : $modules;?> + module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange'")?> story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : '');?>