Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update course cache when creating new standard forums!

  • Loading branch information...
commit a6fcdf98af4db063ff8c01ab8f7bcff5ea5f4fdf 1 parent 7e72f66
moodler authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 mod/forum/lib.php
View
7 mod/forum/lib.php
@@ -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");
Please sign in to comment.
Something went wrong with that request. Please try again.