Commit a0a0ed66 authored by Elias Englmeier's avatar Elias Englmeier
Browse files

fixed a map bug

parent 9cf3ddc6
......@@ -49,8 +49,6 @@ public class MapModulePortlet extends MVCPortlet {
String result = null;
User user;
if(ProjectLocalServiceUtil.getProjectByLayoutIdRef(themeDisplay.getLayout().getPrimaryKey()) != null){
System.out.println("MM: 1");
System.out.println(ProjectLocalServiceUtil.getProjectByLayoutIdRef(themeDisplay.getLayout().getPrimaryKey()));
long projectId = ProjectLocalServiceUtil.getProjectByLayoutIdRef(themeDisplay.getLayout().getPrimaryKey()).getPrimaryKey();
try {
user = PortalUtil.getUser(renderRequest);
......@@ -71,11 +69,15 @@ public class MapModulePortlet extends MVCPortlet {
result = JSONFactoryUtil.looseSerializeDeep(IdeasLocalServiceUtil.getIdeasByUserRoleProjectId(RoleConstants.GUEST, -1, projectId));
}
if(result.isEmpty()){
//at least return all accepted ideas in any case
result = JSONFactoryUtil.looseSerializeDeep(IdeasLocalServiceUtil.getAllAccpetedIdeas());
}
renderRequest.setAttribute("allIdeas", result);
}
else if (IdeasLocalServiceUtil.getIdeasByLayoutIdRef(themeDisplay.getLayout().getPrimaryKey()) != null){
System.out.println("MM: 2");
ArrayList<Ideas> tmp = new ArrayList<Ideas>();
Ideas i = IdeasLocalServiceUtil.getIdeasByLayoutIdRef(themeDisplay.getLayout().getPrimaryKey());
tmp.add(i);
......@@ -83,7 +85,6 @@ public class MapModulePortlet extends MVCPortlet {
JSONFactoryUtil.looseSerializeDeep(tmp));
}
else{
System.out.println("MM: 3");
renderRequest.setAttribute("allIdeas",JSONFactoryUtil.looseSerializeDeep(IdeasLocalServiceUtil.getAllAccpetedIdeas()));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment