From 7ae8f4a32a1a309718434073f9c816cc77bbd44d Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Mon, 26 Apr 2021 09:22:48 +0800 Subject: [PATCH] * Fix bug #12371. --- module/testcase/control.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 0db7e2a38b..dba61c1b25 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -617,8 +617,6 @@ class testcase extends control } } - $product = $this->product->getByID($case->product); - $branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($case->product); $isLibCase = ($case->lib and empty($case->product)); if($isLibCase) { @@ -633,6 +631,9 @@ class testcase extends control else { $productID = $case->product; + $product = $this->product->getByID($productID); + $branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); + if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($this->session->project); if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($this->session->execution); if($this->app->openApp == 'qa') $this->testcase->setMenu($this->products, $productID, $case->branch); @@ -640,6 +641,8 @@ class testcase extends control $this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID]; $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->product = $product; + $this->view->branches = $branches; $this->view->productName = $this->products[$productID]; $this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $case->branch, ''); } @@ -659,7 +662,6 @@ class testcase extends control $this->view->case = $case; $this->view->from = $from; $this->view->taskID = $taskID; - $this->view->product = $product; $this->view->version = $version ? $version : $case->version; $this->view->modulePath = $this->tree->getParents($case->module); $this->view->caseModule = empty($case->module) ? '' : $this->tree->getById($case->module); @@ -669,7 +671,6 @@ class testcase extends control $this->view->runID = $from == 'testcase' ? 0 : $run->id; $this->view->isLibCase = $isLibCase; $this->view->caseFails = $caseFails; - $this->view->branches = $branches; $this->display(); }