From 3dc2ee8dd0874fe2181c3bb4e9eaaf2890c009db Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 17 Oct 2022 11:04:52 +0800 Subject: [PATCH] * Fix bug #28427. --- module/execution/control.php | 5 ++++- module/execution/model.php | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 7f4b14c3e3..be252de99e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3297,6 +3297,9 @@ class execution extends control $pager = new pager($recTotal, $recPerPage, $pageID); $allStories = array_chunk($allStories, $pager->recPerPage); + $project = $object; + if(strpos('sprint,stage,kanban', $object->type) !== false) $project = $this->loadModel('project')->getByID($object->project); + /* Assign. */ $this->view->title = $object->name . $this->lang->colon . $this->lang->execution->linkStory; $this->view->position[] = html::a($browseLink, $object->name); @@ -3312,7 +3315,7 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->branchGroups = $branchGroups; $this->view->browseLink = $browseLink; - $this->view->project = $this->loadModel('project')->getByID($object->project); + $this->view->project = $project; $this->display(); } diff --git a/module/execution/model.php b/module/execution/model.php index 8f38b465b3..2755c3eb16 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2254,8 +2254,9 @@ class executionModel extends model } $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); - $project = $this->loadModel('project')->getByID($execution->project); - if(empty($project->hasProduct)) + $project = $execution; + if(strpos('sprint,stage,kanban', $execution->type) !== false) $project = $this->loadModel('project')->getByID($execution->project); + if(isset($project->hasProduct) && empty($project->hasProduct)) { unset($this->config->product->search['fields']['product']);