From 4b5d820e71df6feb52aa67ff04f5b5dda59d9cf7 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 29 Dec 2022 07:15:10 +0000 Subject: [PATCH 1/2] * Fix bug #30923. --- module/bug/model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index dad2de58be..6cca6f7e6e 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3713,8 +3713,13 @@ 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') + { + $productID = current($bugs)->product; + $relatedObjects = $this->dao->select($pairs)->from($table)->where('product')->eq($productID)->fetchPairs(); + } - if(in_array($object, array('build','resolvedBuild'))) $relatedObjects= array('trunk' => $this->lang->trunk) + $relatedObjects; + if(in_array($object, array('build','resolvedBuild','branch'))) $relatedObjects= array('trunk' => $this->lang->trunk) + $relatedObjects; return array('' => '', 0 => '') + $relatedObjects; } From 421d0b5eaa7cedfe2c59cf2f105705d6c60c270d Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 29 Dec 2022 08:26:22 +0000 Subject: [PATCH 2/2] * Adjust code for bug 30923. --- module/bug/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 6cca6f7e6e..2aab64dc60 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3715,11 +3715,11 @@ class bugModel extends model if($table) $relatedObjects = $this->dao->select($pairs)->from($table)->where('id')->in($relatedObjectIdList)->fetchPairs(); if($object == 'branch' and $this->session->currentProductType != 'normal') { - $productID = current($bugs)->product; + $productID = current($bugs)->product; $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','branch'))) $relatedObjects = array('trunk' => $this->lang->trunk) + $relatedObjects; return array('' => '', 0 => '') + $relatedObjects; }