Skip to content
Snippets Groups Projects
Commit f8879537 authored by srosse's avatar srosse
Browse files

OO-1068: fix RS if a wiki is (probably) imported and has a forum

parent 0d6e2fa5
No related branches found
No related tags found
No related merge requests found
...@@ -653,17 +653,18 @@ public class WikiMainController extends BasicController implements CloneableCont ...@@ -653,17 +653,18 @@ public class WikiMainController extends BasicController implements CloneableCont
* tabbed pane change to discussion tab * tabbed pane change to discussion tab
**********************************************************************/ **********************************************************************/
Forum forum = null; Forum forum = null;
if (page.getForumKey() == 0) { if (page.getForumKey() > 0) {
forum = ForumManager.getInstance().loadForum(Long.valueOf(page.getForumKey()));
}
if(forum == null) {
forum = ForumManager.getInstance().addAForum(); forum = ForumManager.getInstance().addAForum();
page.setForumKey(forum.getKey().longValue()); page.setForumKey(forum.getKey().longValue());
WikiManager.getInstance().updateWikiPageProperties(ores, page); WikiManager.getInstance().updateWikiPageProperties(ores, page);
} else {
forum = ForumManager.getInstance().loadForum(Long.valueOf(page.getForumKey()));
} }
// TODO enhance forum callback with subscription stuff // TODO enhance forum callback with subscription stuff
boolean isModerator = securityCallback.mayModerateForum(); boolean isModerator = securityCallback.mayModerateForum();
ForumCallback forumCallback = new WikiForumCallback(ureq.getUserSession().getRoles().isGuestOnly(), isModerator); ForumCallback forumCallback = new WikiForumCallback(ureq.getUserSession().getRoles().isGuestOnly(), isModerator);
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(forum); ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(forum);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl()); WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment