From daffe7c220114928c0cd673cd52f0552ca1aac1c Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 31 May 2022 17:41:18 +0800 Subject: [PATCH] * Handle modules without non-trunk branches. --- module/upgrade/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index c0ecfd21f8..c07193ea81 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -5719,6 +5719,7 @@ class upgradeModel extends model public function updateObjectBranch() { $moduleBranchPairs = $this->dao->select('id,branch')->from(TABLE_MODULE)->where('branch')->ne(0)->fetchPairs(); + if(empty($moduleBranchPairs)) return true; $storyModulePairs = $this->dao->select('module')->from(TABLE_STORY)->where('module')->in(array_keys($moduleBranchPairs))->andWhere('branch')->eq(0)->fetchPairs(); foreach($storyModulePairs as $moduleID) $this->dao->update(TABLE_STORY)->set('`branch`')->eq($moduleBranchPairs[$moduleID])->where('module')->eq($moduleID)->exec();