MDL-39148 Non-installed plugins cannot be uninstalled
If the plugin has been only deployed to the disk without installing into the database, do not allow going through the uninstallation procedure. Not only it does not have much sense. But it can also lead to some tricky situation due to dependencies. Better to block it and wait till the plugin is either fully installed or removed from the disk.
This commit is contained in:
@@ -948,6 +948,12 @@ class plugin_manager {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($pluginfo->get_status() === plugin_manager::PLUGIN_STATUS_NEW) {
|
||||
// The plugin is not installed. It should be either installed or removed from the disk.
|
||||
// Relying on this temporary state may be tricky.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_null($pluginfo->get_uninstall_url())) {
|
||||
// Backwards compatibility.
|
||||
debugging('plugininfo_base subclasses should use is_uninstall_allowed() instead of returning null in get_uninstall_url()',
|
||||
|
||||
Reference in New Issue
Block a user