From 9816d8afc07f6a01bd6a67def9df8e388ce03e25 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Tue, 8 Jan 2008 23:23:19 +0000 Subject: [PATCH] MDL-12884: cli installer should create the context for the Miscellaneous course category --- admin/cliupgrade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/cliupgrade.php b/admin/cliupgrade.php index 95749584fa..08757be749 100644 --- a/admin/cliupgrade.php +++ b/admin/cliupgrade.php @@ -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!"); -- 2.39.5