From e655e4fad153595b4d3816249fa5dcd34be299da Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 31 Mar 2022 15:55:49 +0800 Subject: [PATCH 1/2] * Fix bug #18035. --- module/story/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/story/model.php b/module/story/model.php index eab6a9657c..61e9fd7bb2 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2663,6 +2663,8 @@ class storyModel extends model { $storyQuery .= " AND `status` NOT IN ('draft', 'closed')"; } + + if($this->app->rawModule == 'build' and $this->app->rawMethod == 'linkstory') $storyQuery .= " AND `parent` != '-1'"; } elseif(strpos($storyQuery, $allBranch) !== false) { From 37bfaafccc4f1ecbc54b7e8b7ac0be2ee3a169e4 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 1 Apr 2022 10:13:37 +0800 Subject: [PATCH 2/2] * Fixed the issue that the product whitelist was lost when upgrading to classic mode. --- module/upgrade/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 3d1002f169..95392cc46c 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -5257,8 +5257,9 @@ class upgradeModel extends model $products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('acl')->eq('custom')->fetchAll(); foreach($products as $product) { - $groups = explode(',', $product->whitelist); - $accounts = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account'); + $groups = explode(',', $product->whitelist); + $accounts = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account'); + $whiteList = ''; foreach($accounts as $account) { $acl = new stdclass(); @@ -5269,9 +5270,11 @@ class upgradeModel extends model $acl->source = 'upgrade'; $this->dao->insert(TABLE_ACL)->data($acl)->exec(); + + $whiteList .= ',' . $account; } - $this->dao->update(TABLE_PRODUCT)->set('acl')->eq('private')->where('id')->eq($product->id)->exec(); + $this->dao->update(TABLE_PRODUCT)->set('acl')->eq('private')->set('whitelist')->eq($whiteList)->where('id')->eq($product->id)->exec(); } return true;