Skip to content

Commit

Permalink
The teacher forum has no coursemodule and this led to errors in parti…
Browse files Browse the repository at this point in the history
…cular in forum_print_latest_discussions().
  • Loading branch information
gustav_delius committed Feb 18, 2005
1 parent cec884a commit 56c0715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mod/forum/lib.php
Expand Up @@ -2552,7 +2552,10 @@ function forum_print_latest_discussions($forum_id=0, $forum_numdiscussions=5,
error("Could not find the course this forum belongs to!");
}
if (! $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
error("Course Module ID was incorrect");
// This happens for example for the teacher forum
$cm->id = NULL;
$cm->visible = 1;
$cm->course = $course->id;
}
require_course_login($course, true, $cm);

Expand Down
2 changes: 2 additions & 0 deletions mod/forum/view.php
Expand Up @@ -43,6 +43,8 @@
$buttontext = update_module_button($cm->id, $course->id, $strforum);
} else {
$cm->id = NULL;
$cm->visible = 1;
$cm->course = $course->id;
$buttontext = "";
}

Expand Down

0 comments on commit 56c0715

Please sign in to comment.