1

Using alfresco community 5.0.d.

I am suddenly getting below error for people methods in pickerchildren.get.js file.

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)

Error in console:

{
"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"
}

Where else in other part of the file people methods are working fine.

Below is code that I had added:

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;
}

It was working fine earlier but suddenly broke down.

Also person is coming as undefined.

Any idea is apprepicated. Thanks!

nikhil84
  • 3,235
  • 4
  • 22
  • 43

1 Answers1

1

You can see from the error message that JavaScript is looking for a method getContainerGroups that accepts an undefined object.

Based on that, I suspect personObj is null. You should add a guard against adding null items to the results array and see if that helps.

Jeff Potts
  • 10,468
  • 17
  • 40
  • 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) – nikhil84 Mar 22 '17 at 14:39
  • It's giving error that it can't find Can't find method getContainerGroups or isAdmin method for people api – nikhil84 Mar 22 '17 at 14:40
  • Where is this code running? Alfresco WAR or Share WAR? – Jeff Potts Mar 23 '17 at 19:51
  • Alfresco (Path: /Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/forms/pickerchildren.get.js) – nikhil84 Mar 23 '17 at 22:24
  • Did you change anything else, such as the descriptor? Also, rather than change the out-of-the-box web script, which is a bad practice, you should at least copy the controller into your own package structure under extensions. – Jeff Potts Mar 24 '17 at 14:40
  • I'm doing changs out-of-box and now reverted back to last changes committed. Everything looks good now. Still wondering what caused that issue. (Difference was just in single method that I was overriding) – nikhil84 Mar 28 '17 at 15:03