MDL-41437 fix plugin install issues
This patch prevents inclusion of settings from plugin that or not yet installed or upgraded, this matches the original logic where we were using the modules table.
This commit is contained in:
@@ -2703,6 +2703,24 @@ abstract class plugininfo_base {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this plugin already installed and updated?
|
||||
* @return bool true if plugin installed and upgraded.
|
||||
*/
|
||||
public function is_updated() {
|
||||
if (!$this->rootdir) {
|
||||
return false;
|
||||
}
|
||||
if ($this->versiondb === null and $this->versiondisk === null) {
|
||||
// There is no version.php or version info inside,
|
||||
// for now let's pretend it is ok.
|
||||
// TODO: return false once we require version in each plugin.
|
||||
return true;
|
||||
}
|
||||
|
||||
return ((float)$this->versiondb === (float)$this->versiondisk);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets {@link $displayname} property to a localized name of the plugin
|
||||
*/
|
||||
@@ -3968,6 +3986,9 @@ class plugininfo_format extends plugininfo_base {
|
||||
global $DB;
|
||||
|
||||
$plugins = plugin_manager::instance()->get_installed_plugins('format');
|
||||
if (!$plugins) {
|
||||
return array();
|
||||
}
|
||||
$installed = array();
|
||||
foreach ($plugins as $plugin => $version) {
|
||||
$installed[] = 'format_'.$plugin;
|
||||
|
||||
Reference in New Issue
Block a user