1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-12 11:15:49 +02:00

Update course cache when creating new standard forums!

This commit is contained in:
moodler 2002-11-14 02:33:48 +00:00
parent 7e72f66016
commit a6fcdf98af

@ -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");