diff --git a/module/bug/control.php b/module/bug/control.php index 05a53f6385..8a236a5d24 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -126,8 +126,9 @@ class bug extends control $users = $this->user->getPairs('noletter'); /* Process the openedBuild and resolvedBuild fields. */ - $builds = $this->loadModel('build')->getProductBuildPairs($productID); - foreach($bugs as $key => $bug) + foreach($bugs as $bug) $productIdList[] = $bug->product; + $builds = $this->loadModel('build')->getProductBuildPairs($productIdList); + foreach($bugs as $key => $bug) { $openBuildIdList = explode(',', $bug->openedBuild); $openedBuild = ''; diff --git a/module/build/model.php b/module/build/model.php index 1b3dde0c7a..53334fcc14 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -85,19 +85,19 @@ class buildModel extends model /** * Get builds of a product in pairs. * - * @param int $productID + * @param mix $products int|array * @param string $params noempty|notrunk, can be a set of them * @access public * @return string */ - public function getProductBuildPairs($productID, $params = '') + public function getProductBuildPairs($products, $params = '') { $sysBuilds = array(); if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); $builds = $this->dao->select('id,name')->from(TABLE_BUILD) - ->where('product')->eq((int)$productID) + ->where('product')->eq($products) ->andWhere('deleted')->eq(0) ->orderBy('date desc, id desc')->fetchPairs(); if(!$builds) return $sysBuilds;