1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

MDL-24089 preventing any plugin upgrades if downgraded core detected; localising error message

This commit is contained in:
Petr Skoda 2010-09-05 19:16:42 +00:00
parent 7efd488e76
commit 80380bd79b
3 changed files with 4 additions and 2 deletions

@ -77,7 +77,7 @@ require("$CFG->dirroot/version.php"); // defines $version and $release
$CFG->target_release = $release; // used during installation and upgrades
if ($version < $CFG->version) {
cli_error('The code you are using is OLDER than the version that made these databases!'); // TODO: localize
cli_error(get_string('downgradedcore', 'error'));
}
$newversion = "$release ($version)";

@ -249,7 +249,8 @@ if ($version > $CFG->version) { // upgrade
upgrade_core($version, true);
}
} else if ($version < $CFG->version) {
echo $OUTPUT->notification('WARNING!!! The code you are using is OLDER than the version that made these databases!');
// better stop here, we can not continue with plugin upgrades or anything else
throw new moodle_exception('downgradedcore', 'error', new moodle_url('/admin/'));
}
// Updated human-readable release version if necessary

@ -195,6 +195,7 @@ $string['detectedbrokenplugin'] = 'Plugin "{$a}" is defective or outdated, can n
$string['dmlreadexception'] = 'Error reading from database';
$string['dmltransactionexception'] = 'Database transaction error';
$string['dmlwriteexception'] = 'Error writing to database';
$string['downgradedcore'] = 'ERROR!!! The code you are using is OLDER than the version that made these databases!';
$string['downloadedfilecheckfailed'] = 'Downloaded file check failed';
$string['duplicateparaminsql'] = 'ERROR: duplicate parameter name in query';
$string['duplicaterolename'] = 'There is already a role with this name!';