From 425f6265b6d8260a8aabcf9dea6bf0f159cdc131 Mon Sep 17 00:00:00 2001 From: lichengjun Date: Thu, 2 Sep 2021 08:35:06 +0000 Subject: [PATCH] * fix bug 14612. --- module/gitlab/model.php | 7 +++++++ module/job/view/exec.html.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 5bd5a65153..c16d1c1af8 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -279,9 +279,16 @@ class gitlabModel extends model $refList = array(); $branches = $this->loadModel('gitlab')->apiGetBranches($gitlabID, $projectID); $tags = $this->loadModel('gitlab')->apiGetTags($gitlabID, $projectID); + + /* fix bug 14612*/ + if(isset($branches->message)) return array(); + + if(isset($branches->error)) return array(); + foreach($branches as $branch) $refList[] = "Branch::" . $branch->name; foreach($tags as $tag) $refList[] = "Tag::" . $tag->name; return $refList; + } /** diff --git a/module/job/view/exec.html.php b/module/job/view/exec.html.php index 140725b899..5390c53d4f 100644 --- a/module/job/view/exec.html.php +++ b/module/job/view/exec.html.php @@ -21,7 +21,7 @@ job->runPipeline); + echo html::submitButton($lang->job->runPipeline, '', empty($refList) ? 'disabled btn btn-primary' : 'btn btn-primary'); ?>