]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug MDL-6385
authorvyshane <vyshane>
Tue, 29 Aug 2006 02:09:31 +0000 (02:09 +0000)
committervyshane <vyshane>
Tue, 29 Aug 2006 02:09:31 +0000 (02:09 +0000)
mod/forum/db/mysql.php
mod/forum/db/postgres7.php

index 6cd2a9f60630b81857742cd9c8b066c2412503ca..a1d890df731d300031b8cfa1e2643352833a2cc9 100644 (file)
@@ -247,25 +247,23 @@ function forum_upgrade($oldversion) {
                      'for teacher forums will have to be manually set after '.
                      'this upgrade.');
           }
-          
           foreach ($forums as $forum) {
               if (!forum_convert_to_roles($forum, $forummod->id,
                         $studentroles, $guestroles)) {
                   notice('Forum with id '.$forum->id.' was not upgraded');
               }
           }
-          
-          // Drop column forum.open.
-          modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN open;');
-          
-          // Drop column forum.assesspublic.
-          modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN assesspublic;');
-          
           // We need to rebuild all the course caches to refresh the state of
           // the forum modules.
           rebuild_course_cache();
           
       } // End if.
+      
+      // Drop column forum.open.
+      modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN open;');
+        
+      // Drop column forum.assesspublic.
+      modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN assesspublic;');
   }
 
   if ($oldversion < 2006082700) {
index d3c3bea5fbb2675c89f98e8720c523f2ed0d5ba9..204d139fd11b6659ffef878ba3f775eeaa86dffa 100644 (file)
@@ -237,25 +237,23 @@ function forum_upgrade($oldversion) {
                      'for teacher forums will have to be manually set after '.
                      'this upgrade.');
           }
-
           foreach ($forums as $forum) {
               if (!forum_convert_to_roles($forum, $forummod->id,
                         $studentroles, $guestroles)) {
                   notice('Forum with id '.$forum->id.' was not upgraded');
               }
           }
-
-          // Drop column forum.open.
-          modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN open;');
-
-          // Drop column forum.assesspublic.
-          modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN assesspublic;');
-
           // We need to rebuild all the course caches to refresh the state of
           // the forum modules.
           rebuild_course_cache();
-
+      
       } // End if.
+      
+      // Drop column forum.open.
+      modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN open;');
+
+      // Drop column forum.assesspublic.
+      modify_database('', 'ALTER TABLE prefix_forum DROP COLUMN assesspublic;');
   }
     
   if ($oldversion < 2006082700) {