From bac6d28a6f82456f98a17a37c3ddfb97b3965df0 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 21 Sep 2007 04:55:14 +0000 Subject: [PATCH] Fixed the definition of SYSCONTEXTID when it's not 1 (like moodle.org) --- lib/setup.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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); } -- 2.39.5