diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 774fe5abdec52..15aad8923a293 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -5034,7 +5034,8 @@ function xmldb_main_upgrade($oldversion) { break; case CONTEXT_COURSECAT : case CONTEXT_SYSTEM : - $context = get_system_context(); + // Stored in the front-page course. + $context = get_context_instance(CONTEXT_COURSE, get_site()->id); break; default : continue;