Skip to content

Commit

Permalink
bugfix(favorites): fix wrong array type
Browse files Browse the repository at this point in the history
the array type must be of type java.lang.Object to create a Scriptable
  • Loading branch information
jgoldhammer committed Oct 17, 2016
1 parent 177f725 commit b02a35f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ScriptNode add(ScriptNode node) {

if(!favouritesService.isFavourite(username, node.getNodeRef())) {
NodeRef nodeRef = favouritesService.addFavourite(username, node.getNodeRef()).getNodeRef();
result = new ScriptNode(nodeRef, serviceRegistry);
result = new ScriptNode(nodeRef, serviceRegistry,getScope());
}

return result;
Expand All @@ -87,7 +87,7 @@ public ScriptNode doWork() throws Exception {
ScriptNode result=null;
if(!favouritesService.isFavourite(username, node.getNodeRef())) {
NodeRef nodeRef = favouritesService.addFavourite(username, node.getNodeRef()).getNodeRef();
result = new ScriptNode(nodeRef, serviceRegistry);
result = new ScriptNode(nodeRef, serviceRegistry, getScope());
}
return result;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public Scriptable getFavorites(int startCount, int limit){
new PagingRequest(startCount, limit));

List<PersonFavourite> favouritesList = favourites.getPage();
PersonFavourite[] favoritesArray = favouritesList.toArray(new PersonFavourite[favouritesList.size()]);
Object[] favoritesArray = favouritesList.toArray(new Object[favouritesList.size()]);

return Context.getCurrentContext().newArray(getScope(), favoritesArray);

Expand Down

0 comments on commit b02a35f

Please sign in to comment.