]> git.mjollnir.org Git - moodle.git/commitdiff
Added some notes for future reference
authorvyshane <vyshane>
Thu, 21 Sep 2006 07:40:24 +0000 (07:40 +0000)
committervyshane <vyshane>
Thu, 21 Sep 2006 07:40:24 +0000 (07:40 +0000)
mod/forum/lib.php
mod/forum/restorelib.php

index 12c87dfd5405f3828507a0f5e98b753c7afaf780..8759e3001fb4944e0a46da832af2e5580c555f75 100644 (file)
@@ -4467,9 +4467,12 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(),
     }
     
     if ($forum->type == 'teacher') {
-        
+
         // Teacher forums should be converted to normal forums that
         // use the Roles System to implement the old behavior.
+        // Note:
+        //   Seems that teacher forums were never backed up in 1.6 since they
+        //   didn't have an entry in the course_modules table.
         require_once($CFG->dirroot.'/course/lib.php');
 
         if (count_records('forum_discussions', 'forum', $forum->id) == 0) {
@@ -4483,8 +4486,8 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(),
             $mod->module = $forummodid;
             $mod->instance = $forum->id;
             $mod->section = 0;
-            $mod->visible = 0;
-            $mod->visibleold = 0;
+            $mod->visible = 0;     // Hide the forum
+            $mod->visibleold = 0;  // Hide the forum
             $mod->groupmode = 0;
 
             if (!$cmid = add_course_module($mod)) {
index 90574083fa0eab6c267c0dd9daec6fa83fc8439c..5340cb34967f8da2c9676b3b0a91f35b5227ba43 100644 (file)
@@ -59,7 +59,6 @@
             $forum->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
             $forum->intro = backup_todb($info['MOD']['#']['INTRO']['0']['#']);
             
-            
             // These get dropped in Moodle 1.7 when the new Roles System gets
             // set up. Therefore they might or not be there depending on whether
             // we are restoring a 1.6+ forum or a 1.7 or later forum backup.
             } else {
                 $status = false;
             }
-            
+
             // If the backup contained $forum->open and $forum->assesspublic,
             // we need to convert the forum to use Roles. It means the backup
-            // was made pre Moodle 1.7. We check the backup_version to make
-            // sure.
+            // was made pre Moodle 1.7.
             if (isset($forum->open) && isset($forum->assesspublic)) {
-            
+
                 $forummod = get_record('modules', 'name', 'forum');
                 
                 if (!$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {