Is it possible that, by design, general type plugins with DB may be installed but not uninstalled? I couldn't find anywhere in the code to suggest otherwise. Surely(?) I'm missing something. Suggestions?
Even if there is no DB, removing the plugin folder merely omits the plugin from the list but does not seem to remove the respective record from mdl_config_plugins. Does it somehow expire? OR seriously?
What do you mean by a 'general type' plugin?
There is now an API function uninstall_plugin that does all the necessary clean-up. However, to be able to invoke that through the Moodle UI requires that plugin type to have a Manage ... plugins page under Plugins in the admin menu, and not all pluigns have that yet.
(Also, there are some like qtypes, where it is using old code, not the uninstall_plugin function. I should fix that. MDL-32324)
A 'general' plugin is any plugin that is not one of the following types:
block
filter
mod
qbehaviour
qtype
auth
enrol
message
repository
portfolio
theme
mnetservice
tool
report
For example, a course format plugin. The plugintype_general class is empty. But surely, if the plugin manager can do a default install of a general plugin, it should be able to do a default uninstall.
Interesting point Itamar as course formats can define DB tables and attributes and as there is no 'course_format.php' in the '/admin' folder that calls the function 'uninstall_plugin' like 'localplugins.php' for example, then removing a course format by removing it's folder (which works fine when no DB additions) leaves stale DB tables, attributes and rows.
Is this a new MDL issue?
Cheers,
Gareth
I don't know if that's new but really this is like having add_instance in a module lib without its delete_instance counterpart. Btw, afaict removing a course format by removing it's folder doesn't work fine when no DB additions, because the record in mdl_config_plugin is not removed.