From cc08fbd602357046cccd7748988a8f3249e58757 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 2 Dec 2020 14:20:41 +0800 Subject: [PATCH] * Fix bug #3640. --- 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 847b1eac10..bc3e6302c4 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1218,7 +1218,12 @@ class bugModel extends model $openedBuilds = $this->post->openedBuild; if($openedBuilds) { - foreach($openedBuilds as $openedBuild) $this->loadModel('build')->unlinkBug($openedBuild, $bugID); + foreach($openedBuilds as $openedBuild) + { + $build = $this->getByID($openedBuild); + $build->bugs = trim(str_replace(",$bugID,", ',', ",$build->bugs,"), ','); + $this->dao->update(TABLE_BUILD)->set('bugs')->eq($build->bugs)->where('id')->eq((int)$openedBuild)->exec(); + } } $bug->activatedCount += 1;