From dc46e684fefdec22af6603d7f473be2a16f37d7c Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 28 Dec 2021 14:10:59 +0800 Subject: [PATCH] * Fix bug #18023. --- lib/scm/gitlab.class.php | 1 + module/mr/model.php | 2 +- module/product/control.php | 2 +- module/story/control.php | 8 ++++---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 044b12e610..2ac9958d55 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -617,6 +617,7 @@ class gitlab $param = new stdclass(); $param->path = urldecode($path); + $param->ref_name = $this->branch; $fromDate = $this->getCommittedDate($fromRevision); $toDate = $this->getCommittedDate($toRevision); diff --git a/module/mr/model.php b/module/mr/model.php index b1b900ed44..a62b597c90 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -1325,7 +1325,7 @@ class mrModel extends model $commits = array(); foreach($DiffCommits as $DiffCommit) { - $commits[] = substr($DiffCommit->id, 0, 10); + if(isset($DiffCommit->id)) $commits[] = substr($DiffCommit->id, 0, 10); } return $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq($type)->andWhere('extra')->in($commits)->fetchPairs('objectID'); diff --git a/module/product/control.php b/module/product/control.php index 5c028d8df9..272fa4ea0d 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -1048,7 +1048,7 @@ class product extends control /* Get product reviewers. */ $product = $this->product->getByID($productID); $productReviewers = $product->reviewer; - if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); + if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); $storyReviewers = ''; if($storyID) diff --git a/module/story/control.php b/module/story/control.php index aa00d7b601..d7bd5edc46 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -305,7 +305,7 @@ class story extends control /* Get reviewers. */ $reviewers = $product->reviewer; - if(!$reviewers) $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); + if(!$reviewers and $product->acl != 'open') $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); /* Set Custom. */ foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field; @@ -469,7 +469,7 @@ class story extends control /* Get reviewers. */ $reviewers = $product->reviewer; - if(!$reviewers) $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); + if(!$reviewers and $product->acl != 'open') $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); /* Init vars. */ $planID = $plan; @@ -685,7 +685,7 @@ class story extends control /* Get product reviewers. */ $productReviewers = $product->reviewer; - if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); + if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); $this->story->replaceURLang($story->type); @@ -937,7 +937,7 @@ class story extends control /* Get product reviewers. */ $productReviewers = $product->reviewer; - if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); + if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', ''); /* Assign. */ $this->view->title = $this->lang->story->change . "STORY" . $this->lang->colon . $this->view->story->title;