From 90c3e3479f8f5e74c5087aaa55f54f079e324976 Mon Sep 17 00:00:00 2001 From: lichengjun Date: Tue, 7 Sep 2021 01:58:24 +0000 Subject: [PATCH] * Fix GitLab MR sync status. --- module/mr/model.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/mr/model.php b/module/mr/model.php index 17cd6a674e..4d0db5997d 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -191,7 +191,6 @@ class mrModel extends model public function apiSyncMR($MR) { $rawMR = $this->apiGetSingleMR($MR->gitlabID, $MR->targetProject, $MR->mriid); - /* Sync MR in ZenTao database whatever status of MR in GitLab. */ if(isset($rawMR->iid)) { @@ -237,9 +236,8 @@ class mrModel extends model { if(!empty($MRList)) foreach($MRList as $MR) { - $rawMR = $this->apiGetSingleMR($MR->gitlabID, $MR->targetProject, $MR->mriid); - if(isset($rawMR->iid) and $rawMR->state != 'merged') + if(isset($rawMR->iid)) { /* create gitlab mr todo to zentao todo */ $this->batchSyncTodo($MR->gitlabID, $MR->targetProject); @@ -248,6 +246,7 @@ class mrModel extends model $gitlabUsers = $this->gitlab->getUserIdAccountPairs($MR->gitlabID); $newMR = new stdclass; + foreach($map as $syncField => $config) { $value = '';