people 方法在 pickerchildren.get.js Alfresco 社区中不起作用

people method is not working in pickerchildren.get.js Alfresco Community

使用露天社区 5.0.d.

pickerchildren.get.js 文件中的人员方法突然出现以下错误。

Can't find method org.alfresco.repo.jscript.People.getContainerGroups(org.mozilla.javascript.Undefined). (classpath*:alfresco/templates/webscripts/org/alfresco/repository/forms/pickerchildren.get.js#366)

控制台错误:

{
"status": {
"code": 500,
"name": "Internal Error",
"description": "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message": "Can't find method org.alfresco.repo.jscript.People.getContainerGroups(org.mozilla.javascript.Undefined). (classpath*:alfresco/templates/webscripts/org/alfresco/repository/forms/pickerchildren.get.js#366)",
"exception": "",
"callstack": [],
"server": "Community v5.0.0 (d r99759-b2) schema 8,022",
"time": "Mar 21, 2017 5:52:17 PM"
}

文件其他部分的其他地方,人们的方法工作正常。

下面是我添加的代码:

if (people.isAdmin(person)) {
    for each(var personRef in personRefs)
    {
        personObj = createPersonResult(search.findNode(personRef));
        // add to results
        results.push({
            item: personObj,
            selectable: true
        });
    }
    return;
}

之前好好的,突然就坏了

Also person is coming as undefined.

欢迎提出任何想法。 谢谢!

从报错信息可以看出,JavaScript正在寻找接受未定义对象的方法getContainerGroups。

基于此,我怀疑 personObj 为空。您应该防止向结果数组添加空项,看看是否有帮助。