]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12884: cli installer should create the context for the Miscellaneous course category
authormjollnir_ <mjollnir_>
Tue, 8 Jan 2008 23:23:19 +0000 (23:23 +0000)
committermjollnir_ <mjollnir_>
Tue, 8 Jan 2008 23:23:19 +0000 (23:23 +0000)
admin/cliupgrade.php

index 95749584fa1198c919313f1e34ca3a56bcc3d902..08757be7492b8de6b1c925016f8d8491ff68382c 100644 (file)
@@ -1195,7 +1195,11 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
 
             $cat = new Object();
             $cat->name = get_string('miscellaneous');
-            if (insert_record('course_categories', $cat)) {
+            $cat->depth = 1;
+            if ($catid = insert_record('course_categories', $cat)) {
+                // make sure category context exists
+                get_context_instance(CONTEXT_COURSECAT, $catid);
+                mark_context_dirty('/'.SYSCONTEXTID);
                 // do nothing
             } else {
                 error("Serious Error! Could not set up a default course category!");