diff --git a/module/execution/control.php b/module/execution/control.php index 1cb40627ce..2ce309c3e4 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1008,17 +1008,14 @@ class execution extends control $queryID = ($type == 'bysearch') ? (int)$param : 0; $actionURL = $this->createLink('execution', 'build', "executionID=$executionID&type=bysearch&queryID=myQueryID"); - if($param) + $product = $param ? $this->loadModel('product')->getById($param) : ''; + if($product and $product->type != 'normal') { - $product = $this->loadModel('product')->getById($param); - if($product and $product->type != 'normal') - { - $this->loadModel('build'); - $this->loadModel('branch'); - $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); - $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); - $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); - } + $this->loadModel('build'); + $this->loadModel('branch'); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); + $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); + $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); } $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'execution');