Skip to content

Commit

Permalink
SAK-40697 - NPE When accessing forums from Lessons (sakaiproject#6065)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Pellicer authored and ern committed Oct 1, 2018
1 parent 9db92b8 commit 7e4e1f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<%
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ValueBinding binding = app.createValueBinding("#{ForumTool}");
DiscussionForumTool forumTool = (DiscussionForumTool) binding.getValue(context);
DiscussionForumTool forumTool = context.getApplication().evaluateExpressionGet(context, "#{ForumTool}", DiscussionForumTool.class);
String target = "";
Expand All @@ -29,7 +27,7 @@
}
}
target = "/jsp/discussionForum/forum/dfForumDetail.jsf?forumId="
target = "/jsp/discussionForum/forum/dfForumDetail.jsp?forumId="
+ request.getParameter("forumId");
forumTool.processActionDisplayForum();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<%
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ValueBinding binding = app.createValueBinding("#{ForumTool}");
DiscussionForumTool forumTool = (DiscussionForumTool) binding.getValue(context);
DiscussionForumTool forumTool = context.getApplication().evaluateExpressionGet(context, "#{ForumTool}", DiscussionForumTool.class);
String target = "";
Expand All @@ -31,7 +29,7 @@
}
if(forumTool.getHasTopicAccessPrivileges(request.getParameter("topicId"))){
target = "/jsp/discussionForum/message/dfAllMessages.jsf?topicId="
target = "/jsp/discussionForum/message/dfAllMessages.jsp?topicId="
+ request.getParameter("topicId");
forumTool.processActionDisplayTopic();
Expand All @@ -49,7 +47,7 @@ if(forumTool.getHasTopicAccessPrivileges(request.getParameter("topicId"))){
if(request.getParameter("topicId") == null) {
// If we're in here it means we have lost topicId. We should direct
// them to the topic's parent forum which will then render the topic.
target = "/jsp/discussionForum/message/dfAllMessages.jsf?forumId="
target = "/jsp/discussionForum/message/dfAllMessages.jsp?forumId="
+ request.getParameter("forumId");
forumTool.processActionDisplayForum();
Expand Down

0 comments on commit 7e4e1f9

Please sign in to comment.