From 212debf30fd42fb887fac084049f03c77e517012 Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 6 Jan 2023 00:52:01 +0000 Subject: [PATCH] * Rollback version, the modification of the data source in the general version has been resolved to avoid conflicts --- module/bug/config.php | 2 +- module/bug/model.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index e4a2983a76..060992e9ab 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -205,7 +205,7 @@ $config->bug->datatable->fieldList['branch']['fixed'] = 'left'; $config->bug->datatable->fieldList['branch']['width'] = '100'; $config->bug->datatable->fieldList['branch']['required'] = 'no'; $config->bug->datatable->fieldList['branch']['control'] = 'select'; -$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name&$productID'); +$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getPairs', 'params' => '$productID'); $config->bug->datatable->fieldList['type']['title'] = 'type'; $config->bug->datatable->fieldList['type']['fixed'] = 'no'; diff --git a/module/bug/model.php b/module/bug/model.php index cc4e95a5bc..e61c3a604f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3711,11 +3711,10 @@ class bugModel extends model * * @param int $object * @param string $pairs - * @param int $productID * @access public * @return void */ - public function getRelatedObjects($object, $pairs = '', $productID = 0) + public function getRelatedObjects($object, $pairs = '') { /* Get bugs. */ $bugs = $this->loadModel('transfer')->getQueryDatas('bug'); @@ -3731,12 +3730,8 @@ class bugModel extends model /* Get related objects title or names. */ $table = $this->config->objectTables[$object]; if($table) $relatedObjects = $this->dao->select($pairs)->from($table)->where('id')->in($relatedObjectIdList)->fetchPairs(); - if($object == 'branch' and $this->session->currentProductType != 'normal') - { - $relatedObjects = $this->dao->select($pairs)->from($table)->where('product')->eq($productID)->fetchPairs(); - } - if(in_array($object, array('build','resolvedBuild','branch'))) $relatedObjects = array('trunk' => $this->lang->trunk) + $relatedObjects; + if(in_array($object, array('build','resolvedBuild'))) $relatedObjects = array('trunk' => $this->lang->trunk) + $relatedObjects; return array('' => '', 0 => '') + $relatedObjects; }