Commit d16de803 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1636286: Testing if root user exists in upgrade sanity"

parents 3552a1da 031b9dcf
......@@ -60,6 +60,7 @@ $string['plpgsqlnotavailable'] = 'The PL/pgSQL language is not enabled in your P
$string['mysqlnotriggerprivilege'] = 'Mahara requires permission to create database triggers, but is unable to do so. Please ensure that the trigger privilege has been granted to the appropriate user in your MySQL installation. For instructions on how to do this, see https://wiki.mahara.org/wiki/System_Administrator\'s_Guide/Granting_Trigger_Privilege';
$string['mbstringneeded'] = 'Please install the mbstring extension for php. This is needed if you have UTF-8 characters in usernames. Otherwise, users might not be able to login.';
$string['cssnotpresent'] = 'CSS files are not present in your htdocs/theme/raw/style directory. If you are running Mahara from a git checkout, run "make css" to build the CSS files. If you are running Mahara from a ZIP download, try downloading and unzipping again.';
$string['mahararootusermissing'] = 'The "root" user is missing from the database so we cannot continue. This user needs to be present for Mahara to function correctly. To add the root user back in please make another install of the Mahara version you are using and see what is contained for user id = 0 in the "usr" and "usr_custom_layout" tables and add that data back in to your instance of Mahara before trying to upgrade again.';
// general exception error messages
$string['blocktypenametaken'] = "Block type %s is already taken by another plugin (%s).";
......
......@@ -203,6 +203,9 @@ function ensure_upgrade_sanity() {
$e->set_log_off();
throw $e;
}
if (!record_exists('usr', 'id', 0)) {
throw new ConfigSanityException(get_string('mahararootusermissing', 'error'));
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment