diff --git a/module/bug/control.php b/module/bug/control.php index cc4f3927ad..966d70ef02 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -565,8 +565,9 @@ class bug extends control } else { - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,noreleased'); - $stories = $this->story->getProductStoryPairs($productID, $branch, 0, 'all','id_desc', 0, 'full', 'story', false); + $moduleID = $moduleID ? $moduleID : 0; + $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,noreleased'); + $stories = $this->story->getProductStoryPairs($productID, $branch, $moduleID, 'all','id_desc', 0, 'full', 'story', false); } $moduleOwner = $this->bug->getModuleOwner($moduleID, $productID); diff --git a/module/story/model.php b/module/story/model.php index 5dc4743075..8bcd0676f5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3022,6 +3022,11 @@ class storyModel extends model */ public function getProductStoryPairs($productID = 0, $branch = 'all', $moduleIdList = 0, $status = 'all', $order = 'id_desc', $limit = 0, $type = 'full', $storyType = 'story', $hasParent = true) { + if($moduleIdList) + { + $moduleInfo = $this->loadModel('tree')->getByID($moduleIdList); + $moduleIdList = $moduleInfo->type == 'bug' ? 0 : $moduleIdList; + } $stories = $this->dao->select('t1.id, t1.title, t1.module, t1.pri, t1.estimate, t2.name AS product') ->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('1=1')