From: moodler Date: Fri, 21 Sep 2007 04:55:14 +0000 (+0000) Subject: Fixed the definition of SYSCONTEXTID when it's not 1 (like moodle.org) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bac6d28a6f82456f98a17a37c3ddfb97b3965df0;p=moodle.git Fixed the definition of SYSCONTEXTID when it's not 1 (like moodle.org) --- diff --git a/lib/setup.php b/lib/setup.php index 46655ce3cf..53ce9e4b59 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -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); }