mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 09:55:33 +02:00
Fixed the definition of SYSCONTEXTID when it's not 1 (like moodle.org)
This commit is contained in:
parent
7e17f43b1c
commit
bac6d28a6f
@ -231,7 +231,7 @@ global $HTTPSPAGEREQUIRED;
|
||||
register_shutdown_function('moodle_request_shutdown');
|
||||
}
|
||||
|
||||
//// Defining the site
|
||||
/// Defining the site
|
||||
if ($SITE = get_site()) {
|
||||
/**
|
||||
* If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
|
||||
@ -249,10 +249,8 @@ global $HTTPSPAGEREQUIRED;
|
||||
$COURSE->id = 1;
|
||||
}
|
||||
|
||||
$sysctxid = get_field('context', 'id',
|
||||
'contextlevel', CONTEXT_SYSTEM);
|
||||
if (!empty($syscontextid)) {
|
||||
define('SYSCONTEXTID', $syscontextid);
|
||||
if ($sysctxid = get_field('context', 'id', 'contextlevel', CONTEXT_SYSTEM)) {
|
||||
define('SYSCONTEXTID', $sysctxid);
|
||||
} else {
|
||||
define('SYSCONTEXTID', 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user