已解决 php7 打开项目中的树状图报错 字符串转数组问题

点开项目->树状图的时候报错,查了一下是php7 字符串转数组的问题:

$branchTrees = '';
if($branchTrees) $productTree[] = array('name' => $this->lang->product->branchName[$productInfo->type], 'root' => $id, 'type' => 'branch', 'actions' => false, 'children' => $branchTrees);

应改为:

$branchTrees = [];


Uncaught Error: [] operator not supported for strings in module/tree/model.php:528

Stack trace:
#0 module/project/model.php(2495): treeModel->getTaskStructure('1', 0, false)
#1 module/project/control.php(1309): projectModel->getProjectTree('1')
#2 framework/base/router.class.php(1691): project->tree('1', '')
#3 www/index.php(67): baseRouter->loadModule()
#4 {main}
thrown in module/tree/model.php on line 528 when visiting /index.php?m=project&f=tree&projectID=1
禅道版本 9.6.3 源码包
操作系统 CentOS
客户端浏览器 Chrome

提问者: 盖世五侠 悬赏:5 日期: 2018-01-06 11:46:11 答案:1 点击 95
设置备注
答案列表
2018/01/08
谢谢反馈,我们记录下这个问题。