Commit 031b9dcf authored by Robert Lyon's avatar Robert Lyon

Bug 1636286: Testing if root user exists in upgrade sanity

The root user needs to exists for Mahara to function correctly

It is used (at least) to hold some default layout options

behatnotneeded

Change-Id: I8a25a2d60a0f2be55b4abb6d86c470d0f7f08786
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 17ef60df
......@@ -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'));
}
}
/**
......
Markdown is supported
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