From 175b4eed67d9a679ea66454070885b0364adb690 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 2 Nov 2023 09:11:28 +0800 Subject: [PATCH] * Fix bug in testcase::importFromLib. --- module/testcase/js/importfromlib.ui.js | 4 ++-- module/testcase/zen.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/testcase/js/importfromlib.ui.js b/module/testcase/js/importfromlib.ui.js index 3657863c77..b290072b6e 100644 --- a/module/testcase/js/importfromlib.ui.js +++ b/module/testcase/js/importfromlib.ui.js @@ -18,8 +18,8 @@ window.updateTable = function(name, value, formData) window.getModuleCellProps = function(cell) { const caseID = cell.row.data.id; - const branchID = this.getFormData(`branch[${cell.row.data.id}]`); - const modules = canImportModules[branchID][caseID]; + const branchID = this.getFormData(`branch[${cell.row.data.id}]`) != undefined ? this.getFormData(`branch[${cell.row.data.id}]`) : cell.row.data.branch; + const modules = canImportModules[branchID] != undefined && canImportModules[branchID][caseID] != undefined ? canImportModules[branchID][caseID] : {}; return {items: modules}; } diff --git a/module/testcase/zen.php b/module/testcase/zen.php index 9f43955398..30ef48923e 100644 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -168,7 +168,6 @@ class testcaseZen extends testcase foreach($branches as $branchID => $branchName) $canImportModules[$branchID] = $this->testcase->getCanImportedModules($productID, $libID, $branchID, 'items'); if(empty($branches)) $canImportModules[0] = $this->testcase->getCanImportedModules($productID, $libID, 0, 'items'); - /* Build the search form. */ $actionURL = $this->createLink('testcase', 'importFromLib', "productID={$productID}&branch={$branch}&libID={$libID}&orderBy={$orderBy}&browseType=bySearch&queryID=myQueryID");