From 1f52d98c8b18f7fb99ef7f24104eff3a6f3fe820 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 12 Mar 2021 09:48:11 +0800 Subject: [PATCH] * Fix the problem of creating bugs. --- module/bug/control.php | 2 +- module/bug/model.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index c38d2c8be3..34b4f5c770 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -157,7 +157,7 @@ class bug extends control $productIDList = $productID ? $productID : array_keys($this->products); /* Get bugs. */ - $bugs = $this->bug->getBugs($productIDList, $executions, $branch, $browseType, $moduleID, $queryID, $sort, $pager, $this->session->PRJ); + $bugs = $this->bug->getBugs($productIDList, $executions, $branch, $browseType, $moduleID, $queryID, $sort, $pager, $this->projectID); /* Process the sql, get the conditon partion, save it to session. */ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true); diff --git a/module/bug/model.php b/module/bug/model.php index 6ae5cae8d1..e5e82ed1a5 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -85,6 +85,8 @@ class bugModel extends model ->remove('files, labels,uid,oldTaskID,contactListMenu') ->get(); + if($bug->execution !== 0) $bug->project = $this->dao->select('parent')->from(TABLE_EXECUTION)->where('id')->eq($bug->execution)->fetch('parent'); + /* Check repeat bug. */ $result = $this->loadModel('common')->removeDuplicate('bug', $bug, "product={$bug->product}"); if($result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']); @@ -183,6 +185,8 @@ class bugModel extends model $bug->browser = $data->browsers[$i]; $bug->keywords = $data->keywords[$i]; + if($bug->execution !== 0) $bug->project = $this->dao->select('parent')->from(TABLE_EXECUTION)->where('id')->eq($bug->execution)->fetch('parent'); + /* Assign the bug to the person in charge of the module. */ if(!empty($moduleOwners[$bug->module])) {