Permalink
Browse files

Update course cache when creating new standard forums!

  • Loading branch information...
1 parent 7e72f66 commit a6fcdf98af4db063ff8c01ab8f7bcff5ea5f4fdf moodler committed Nov 14, 2002
Showing with 7 additions and 0 deletions.
  1. +7 −0 mod/forum/lib.php
View
@@ -407,6 +407,8 @@ function forum_grades($forumid) {
function forum_get_course_forum($courseid, $type) {
// How to set up special 1-per-course forums
+ global $CFG;
+
if ($forum = get_record_sql("SELECT * from forum WHERE course = '$courseid' AND type = '$type'")) {
return $forum;
@@ -466,6 +468,11 @@ function forum_get_course_forum($courseid, $type) {
notify("Could not update the course module with the correct section");
return false;
}
+ include_once("$CFG->dirroot/course/lib.php");
+ $modinfo = serialize(get_array_of_activities($courseid));
+ if (!set_field("course", "modinfo", $modinfo, "id", $courseid)) {
+ error("Could not cache module information!");
+ }
}
return get_record("forum", "id", "$forum->id");

0 comments on commit a6fcdf9

Please sign in to comment.