$linktoscrolltoerrors = '<script type="text/javascript" src="' . $CFG->wwwroot . '/lib/scroll_to_errors.js"></script>';
if (! $maintables) {
+ /// hide errors from headers in case debug enabled in config.php
+ $origdebug = $CFG->debug;
+ $CFG->debug = 5;
+ error_reporting($CFG->debug);
if (empty($agreelicence)) {
$strlicense = get_string("license");
print_header($strlicense, $strlicense, $strlicense, "", "", false, " ", " ");
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup,
"", $linktoscrolltoerrors, false, " ", " ");
+ /// return to original debugging level
+ $CFG->debug = $origdebug;
+ error_reporting($CFG->debug);
upgrade_log_start();
$db->debug = true;
$a->newversion = "$release ($version)";
$strdatabasechecking = get_string("databasechecking", "", $a);
+ // hide errors from headers in case debug is enabled
+ $origdebug = $CFG->debug;
+ $CFG->debug = 5;
+ error_reporting($CFG->debug);
+
+ // logout in case we are upgrading from pre 1.7 version - prevention of weird session problems
+ if ($CFG->version < 2006050600) {
+ require_logout();
+ }
+
if (empty($confirmupgrade)) {
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", "", false, " ", " ");
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", $linktoscrolltoerrors, false, " ", " ");
+ /// return to original debugging level
+ $CFG->debug = $origdebug;
+ error_reporting($CFG->debug);
upgrade_log_start();
print_heading($strdatabasechecking);
$db->debug=true;
raise_memory_limit('64M'); // We should never NEED this much but just in case...
+/// Disable errors for now - needed for installation when debug enabled in config.php
+ if (isset($CFG->debug)) {
+ $originalconfigdebug = $CFG->debug;
+ unset($CFG->debug);
+ } else {
+ $originalconfigdebug = -1;
+ }
+
/// If $CFG->unicodedb is not set, get it from database or calculate it because we need
/// to know it to "set names" properly.
/// (this is the only database interaction before "set names")
$db->LogSQL();
}
-
-/// Set error reporting back to normal
- if (!isset($CFG->debug)) { // empty() would override 0 or false from config.php
- $CFG->debug = 5;
+/// Prevent warnings from roles when upgrading with debug on
+ if (isset($CFG->debug)) {
+ $originaldatabasedebug = $CFG->debug;
+ unset($CFG->debug);
+ } else {
+ $originaldatabasedebug = -1;
}
- error_reporting($CFG->debug);
//// Defining the site
}
+/// Set error reporting back to normal
+ if ($originaldatabasedebug == -1) {
+ $CFG->debug = 5;
+ } else {
+ $CFG->debug = $originaldatabasedebug;
+ }
+ if ($originalconfigdebug !== -1) {
+ $CFG->debug = $originalconfigdebug;
+ }
+ unset($originalconfigdebug);
+ unset($originaldatabasedebug);
+ error_reporting($CFG->debug);
+
+
/// Set a default enrolment configuration (see bug 1598)
if (!isset($CFG->enrol)) {
$CFG->enrol = 'manual';