MDL-36840 Set course.format to 'site' for site-course
authorMarina Glancy <marina@moodle.com>
Wed, 5 Dec 2012 02:28:12 +0000 (10:28 +0800)
committerMarina Glancy <marina@moodle.com>
Wed, 5 Dec 2012 02:31:24 +0000 (10:31 +0800)
lib/db/upgrade.php
version.php

index 7242366..4b95964 100644 (file)
@@ -1501,5 +1501,17 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2012112100.00);
     }
 
+    if ($oldversion < 2012120300.01) {
+        // Make sure site-course has format='site' //MDL-36840
+
+        if ($SITE->format !== 'site') {
+            $DB->set_field('course', 'format', 'site', array('id' => $SITE->id));
+            $SITE->format = 'site';
+        }
+
+        // Main savepoint reached
+        upgrade_main_savepoint(true, 2012120300.01);
+    }
+
     return true;
 }
index 1b0aee4..95653af 100644 (file)
@@ -30,7 +30,7 @@
 defined('MOODLE_INTERNAL') || die();
 
 
-$version  = 2012120300.00;              // YYYYMMDD      = weekly release date of this DEV branch
+$version  = 2012120300.01;              // YYYYMMDD      = weekly release date of this DEV branch
                                         //         RR    = release increments - 00 in DEV branches
                                         //           .XX = incremental changes