View Issue Details

IDProjectCategoryView StatusLast Update
0017798phpList 3 applicationpluginspublic16-01-19 09:56
Reporterduncanc Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.2.0 
Fixed in Version3.2.1 
Summary0017798: Plugin remains enabled after dependency is not met
DescriptionThis is a bit of an edge case when installing and enabling plugins.

A plugin has dependencies that are met and so is enabled. If later a dependency becomes not met then the plugin seems to remain enabled.
If you view the plugins page then the plugin is shown as having unmet dependencies but it is still actually enabled.

Depending on what the dependency actually is that might be a problem. I found this when disabling CommonPlugin and found that other plugins that had it as a dependency remained enabled and failed due to the CommonPlugin class not existing.

One solution is to verify the dependencies when loading each plugin.
See file admin/pluginlib.php. Add a test of the dependencies to this line

if (!in_array($className,$GLOBALS['plugins_disabled']) ) {

if (!in_array($className,$GLOBALS['plugins_disabled']) && pluginCanEnable($className)) {

This seems to avoid the problem but you might also want to add the plugin to the set of disabled plugins instead of just ignoring it.
TagsNo tags attached.



15-08-15 13:27

updater   ~0056637

I'm not correct in saying that the plugin remains enabled, rather it is "not disabled".


28-09-15 11:08

administrator   ~0056898

hmm, tricky this. Adding this check depends on the order in which plugins are loaded. I added the check and as a result could not enable a plugin that depended on the common plugin, even when the commonplugin was enabled.

So, it would need two passes to work, which is not great for performance.


01-10-15 12:41

updater   ~0056928

Yes, I see what you mean now.

Possibly another way is, when a plugin is disabled to also test the dependencies of all other plugins, so that a plugin which depends on the one being disabled is also disabled at the same time.


01-10-15 12:47

administrator   ~0056929

Yes, that's a good plan.


02-10-15 18:25

administrator   ~0056941