From 89b23a4c0dd8a6fcc0102d212f99588fff2d91d2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 20 May 2024 10:43:01 +0800 Subject: [PATCH] * Adjust mr commmit date check. --- module/mr/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/mr/control.php b/module/mr/control.php index dd2930cf95..8343b724c5 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -327,7 +327,7 @@ class mr extends control $projectMethod = $host->type == 'gitfox' ? 'apiGetSingleRepo' : 'apiGetSingleProject'; $sourceProject = $this->loadModel($host->type)->$projectMethod($MR->hostID, $MR->sourceProject); - $compile = $this->loadModel('compile')->getById($MR->compileID); + $compile = $this->loadModel('compile')->getByID($MR->compileID); $this->view->title = $this->lang->mr->view; $this->view->MR = $MR; @@ -336,7 +336,7 @@ class mr extends control $this->view->reviewer = $this->loadModel('user')->getById($MR->assignee); $this->view->actions = $this->loadModel('action')->getList('mr', $MRID); $this->view->compile = $compile; - $this->view->hasNewCommit = $this->mrZen->checkNewCommit($host->type, $MR->hostID, (string)$MR->targetProject, $MR->mriid, $compile->createdDate); + $this->view->hasNewCommit = $compile ? $this->mrZen->checkNewCommit($host->type, $MR->hostID, (string)$MR->targetProject, $MR->mriid, $compile->createdDate) : false; $this->view->sourceProject = $sourceProject; $this->view->targetProject = $this->{$host->type}->$projectMethod($MR->hostID, $MR->targetProject); $this->view->sourceBranch = $this->mrZen->getBranchUrl($host, $MR->sourceProject, $MR->sourceBranch);