]> git.mjollnir.org Git - moodle.git/commitdiff
Need to pass the module id and not the object to add_course_module
authorvyshane <vyshane>
Tue, 22 Aug 2006 02:24:45 +0000 (02:24 +0000)
committervyshane <vyshane>
Tue, 22 Aug 2006 02:24:45 +0000 (02:24 +0000)
mod/forum/db/mysql.php

index 384f64f3da44ec969a687503a31e9b4e3a9cf95b..97db13f99bfd9c98fcb175a7a9490a2eb6a3c67a 100644 (file)
@@ -231,7 +231,7 @@ function forum_upgrade($oldversion) {
   
   if ($oldversion < 2006081800) {
       // Upgrades for new roles and capabilities support.
-      $forummodid = get_record('modules', 'name', 'forum');
+      $forummod = get_record('modules', 'name', 'forum');
       
       if ($forums = get_records('forum')) {
           
@@ -258,7 +258,7 @@ function forum_upgrade($oldversion) {
                       // section 0 in the course.
                       $mod = new object;
                       $mod->course = $forum->course;
-                      $mod->module = $forummodid;
+                      $mod->module = $forummod->id;
                       $mod->instance = $forum->id;
                       $mod->section = 0;
                       $mod->visible = 0;