From 2db08abb3e4132d132ccb7fc851c076329668c3f Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 24 Apr 2023 15:48:10 +0800 Subject: [PATCH 1/4] * Modify story linked data type. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index fb92c42f96..1af6c7dbde 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3319,7 +3319,7 @@ class executionModel extends model $data->branch = $storyList[$storyID]->branch; $data->story = $storyID; $data->version = $versions[$storyID]; - $data->order = ++$lastOrder; + $data->order = (int)++$lastOrder; $this->dao->replace(TABLE_PROJECTSTORY)->data($data)->exec(); $this->story->setStage($storyID); From 8fea8db065a479e16c07f3a5398ba17d17fbdc32 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 24 Apr 2023 15:48:47 +0800 Subject: [PATCH 2/4] * Modify database connect dsn. --- lib/dbh/dbh.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dbh/dbh.class.php b/lib/dbh/dbh.class.php index 49d0d1d22b..7f672291e6 100644 --- a/lib/dbh/dbh.class.php +++ b/lib/dbh/dbh.class.php @@ -45,7 +45,7 @@ class dbh */ public function __construct($config, $setSchema = true) { - $dsn = "{$config->driver}:host={$config->host}:{$config->port}"; + $dsn = "{$config->driver}:host={$config->host};port={$config->port}"; if($setSchema) $dsn .= ";dbname={$config->name}"; $pdo = new PDO($dsn, $config->user, $config->password); From 4d12147600d33fc1891a3e18c5c4543ddc7603a3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 24 Apr 2023 23:17:42 +0800 Subject: [PATCH 3/4] * Modify database field. --- extension/lite/product/ext/model/getpairs.php | 2 +- module/product/model.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/lite/product/ext/model/getpairs.php b/extension/lite/product/ext/model/getpairs.php index 0796a1e0d7..94725eee04 100644 --- a/extension/lite/product/ext/model/getpairs.php +++ b/extension/lite/product/ext/model/getpairs.php @@ -25,7 +25,7 @@ public function getPairs($mode = '', $programID = 0, $append = '', $shadow = 0) ->andWhere('t2.vision')->eq($this->config->vision) ->fetchPairs('id', 'id'); - $products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed') + $products = $this->dao->select("*, IF(INSTR(' closed', status) < 2, 0, 1) AS isClosed") ->from(TABLE_PRODUCT) ->where(1) ->beginIF(strpos($mode, 'all') === false)->andWhere('deleted')->eq(0)->fi() diff --git a/module/product/model.php b/module/product/model.php index b34abb85fb..8ab5432739 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -244,6 +244,7 @@ class productModel extends model */ public function getById($productID) { + $productID = (int)$productID; if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProduct(); $product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); if(!$product) return false; From 44a0d56a017de1e881e6034c0b87ad2e36b910b9 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 24 Apr 2023 23:30:35 +0800 Subject: [PATCH 4/4] * Fix bug #34753. --- module/build/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index 383c19ffee..8e1319f005 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -254,7 +254,7 @@ class buildModel extends model $buildIdList = str_replace('trunk', '0', $buildIdList); $selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD) ->where('id')->in($buildIdList) - ->beginIF($products)->andWhere('product')->in($productIdList)->fi() + ->beginIF($products and $products != 'all')->andWhere('product')->in($productIdList)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi() ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi() @@ -274,7 +274,7 @@ class buildModel extends model ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() - ->beginIF($products)->andWhere('t1.product')->in($productIdList)->fi() + ->beginIF($products and $products != 'all')->andWhere('t1.product')->in($productIdList)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('t1.execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('t1.project')->eq($objectID)->fi() ->orderBy('t1.date desc, t1.id desc')->fetchAll('id');