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:
David Mudrák
2013-04-19 11:24:43 +02:00
parent 3a8c4380c0
commit badf464792
3 changed files with 23 additions and 2 deletions
+6
View File
@@ -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()',