diff --git a/module/tree/model.php b/module/tree/model.php index 5209bcdb85..81cbfbf21d 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -277,11 +277,12 @@ class treeModel extends model { foreach($rootModules as $id => $rootModule) { + $activeBranch = isset($branchGroups[$id]) ? array_keys($branchGroups[$id]) : array(); if($type == 'product') { $modules = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = '" . (int)$rootID . "' and type = 'task' and parent != 0) OR (root = $id and type = 'story'))") ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() - ->andWhere('branch')->in(array_keys($branchGroups[$id])) + ->beginIF(!empty($activeBranch))->andWhere('branch')->in($activeBranch)->fi() ->andWhere('deleted')->eq(0) ->orderBy('grade desc, branch, `order`, type') ->fetchAll('id');