MDL-12884: cli installer should create the context for the Miscellaneous course category

This commit is contained in:
mjollnir_ 2008-01-08 23:23:19 +00:00
parent 7ce4ce0aa4
commit 9816d8afc0

View 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!");