Skip to content

Commit

Permalink
Merge branch 'MDL-66917-37' of https://github.com/paulholden/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_37_STABLE
  • Loading branch information
andrewnicols committed May 15, 2020
2 parents bce5596 + 536c771 commit 4e2dd1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/en/plugin.php
Expand Up @@ -225,6 +225,7 @@
$string['validationmsg_onedir_help'] = 'The ZIP package must contain just one root directory that holds the plugin code. The name of that root directory must match the name of the plugin.';
$string['validationmsg_pathwritable'] = 'Write access check';
$string['validationmsg_pluginversion'] = 'Plugin version';
$string['validationmsg_pluginversiontoolow'] = 'A higher version of this plugin is already installed';
$string['validationmsg_release'] = 'Plugin release';
$string['validationmsg_requiresmoodle'] = 'Required Moodle version';
$string['validationmsg_rootdir'] = 'Name of the plugin to be installed';
Expand Down
7 changes: 7 additions & 0 deletions lib/classes/update/validator.php
Expand Up @@ -394,6 +394,13 @@ protected function validate_version_php() {
}
$this->add_message(self::INFO, 'componentmatch', $this->versionphp['component']);

// Ensure the version we are uploading is higher than the version currently installed.
$plugininfo = $this->get_plugin_manager()->get_plugin_info($this->versionphp['component']);
if (!is_null($plugininfo) && $this->versionphp['version'] < $plugininfo->versiondb) {
$this->add_message(self::ERROR, 'pluginversiontoolow', $plugininfo->versiondb);
return false;
}

if (isset($info['plugin->maturity'])) {
$this->versionphp['maturity'] = $info['plugin->maturity'];
if ($this->versionphp['maturity'] === 'MATURITY_STABLE') {
Expand Down

0 comments on commit 4e2dd1a

Please sign in to comment.