From b9868c6955ee7e9f7a73ed8487bfcf982c621eab Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 30 Nov 2023 08:52:52 +0800 Subject: [PATCH] * Adjust sonar issue for mr. --- module/mr/control.php | 2 +- module/mr/ui/browse.html.php | 3 ++- module/mr/zen.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/mr/control.php b/module/mr/control.php index b31244c1d1..4360a340d7 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -56,7 +56,7 @@ class mr extends control $this->session->set('execution', $objectID); $execution = $this->loadModel('execution')->getByID($objectID); $features = $this->execution->getExecutionFeatures($execution); - if(!$features['devops']) return $this->locate($this->createLink('execution', 'task', "objectID=$executionID")); + if(!$features['devops']) return $this->locate($this->createLink('execution', 'task', "objectID=$objectID")); $this->loadModel('execution')->setMenu($objectID); } diff --git a/module/mr/ui/browse.html.php b/module/mr/ui/browse.html.php index 668a4d1cff..e20275d995 100644 --- a/module/mr/ui/browse.html.php +++ b/module/mr/ui/browse.html.php @@ -59,6 +59,7 @@ featureBar set::linkParams("repoID={$repo->id}&mode=status¶m={key}") ); +$linkParams = $app->tab == 'devops' ? "repoID={$repo->id}" : ''; toolBar ( hasPriv('mr', 'create') ? item(set(array @@ -66,7 +67,7 @@ toolBar 'text' => $lang->mr->create, 'icon' => 'plus', 'class' => 'btn primary', - 'url' => createLink('mr', 'create', $app->tab == 'devops' ? "repoID={$repo->id}" : '') + 'url' => createLink('mr', 'create', $linkParams) ))) : null ); diff --git a/module/mr/zen.php b/module/mr/zen.php index 2d6eeab496..6d05cd410d 100644 --- a/module/mr/zen.php +++ b/module/mr/zen.php @@ -178,7 +178,7 @@ class mrZen extends mr * @access protected * @return void */ - protected function buildLinkTaskSearchForm(int $MRID, object $product, string $orderBy, int $queryID = 0, array $productExecutions) + protected function buildLinkTaskSearchForm(int $MRID, object $product, string $orderBy, int $queryID, array $productExecutions) { $modules = $this->loadModel('tree')->getOptionMenu($product->id, 'task');