webman-php / admin

admin plugin for webman
MIT License
315 stars 31 forks source link

fix: 解决/url/select?format=table_tree 的bug #56

Closed Mr-ShiHuaYu closed 1 year ago

Mr-ShiHuaYu commented 1 year ago

bug 出现的时机: 当请求的url为 /unit/select?format=table_tree 时,会报错,错误提示:

ErrorException: Indirect modification of overloaded element of app\model\UnitTree has no effect in D:\4.PHP\Code\webman-zbcms\plugin\admin\app\common\Tree.php:101
Stack trace:
#0 D:\4.PHP\Code\webman-zbcms\plugin\admin\app\common\Tree.php(101): support\App::{closure}(8, 'Indirect modifi...', 'D:\\4.PHP\\Code\\w...', 101)
#1 D:\4.PHP\Code\webman-zbcms\plugin\admin\app\common\Tree.php(55): plugin\admin\app\common\Tree->getHashTree()

原因是因为,在Crud.php获取items时,得到的是一个外面是数组,里面是一个对象app\model\UnitTree的 Object, 在Tree的构造函数中,这句转为数组的代码就不会起到作用了。 本人拙劣的改了一下,仅供参考。

walkor commented 1 year ago

Thanks