Skip to content

Commit

Permalink
MDL-24089 preventing any plugin upgrades if downgraded core detected;…
Browse files Browse the repository at this point in the history
… localising error message
  • Loading branch information
skodak committed Sep 5, 2010
1 parent 7efd488 commit 80380bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/cli/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
$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)";
Expand Down
3 changes: 2 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@
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
Expand Down
1 change: 1 addition & 0 deletions lang/en/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
$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!';
Expand Down

0 comments on commit 80380bd

Please sign in to comment.