diff --git a/module/compile/model.php b/module/compile/model.php index 3da3233e36..ce3a4b538b 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -134,7 +134,7 @@ class compileModel extends model if($job->triggerType == 'tag') { - $lastTag = $this->getLastTagByRepo($repo); + $lastTag = $this->loadModel('job')->getLastTagByRepo($repo); if($lastTag) { $job->lastTag = $lastTag; diff --git a/module/job/control.php b/module/job/control.php index 383fe16b1c..b17d81e552 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -352,7 +352,7 @@ class job extends control if($productLeft == $productRight) $matchedProducts[$productName] = $productRight; } } - die(json_encode($matchedProduct)); + die(json_encode($matchedProducts)); } $productName = $this->loadModel('product')->getByID($repo->product)->name; diff --git a/module/job/model.php b/module/job/model.php index c9344e89a4..ecd520b333 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -364,7 +364,7 @@ class jobModel extends model if($job->triggerType == 'tag') { - $lastTag = $this->getLastTagByRepo($repo); + $lastTag = $this->getLastTagByRepo($repo, $job); if($lastTag) { $build->tag = $lastTag; @@ -430,7 +430,7 @@ class jobModel extends model /** * Exec gitlab pipeline. * - * @param int $job + * @param object $job * @access public * @return void */ @@ -473,10 +473,11 @@ class jobModel extends model * Get last tag of one repo. * * @param object $repo + * @param object $job * @access public * @return void */ - public function getLastTagByRepo($repo) + public function getLastTagByRepo($repo, $job) { if($repo->SCM == 'Subversion') {