From a2aa46fd0ec5ee67d12be5fbf7d15742b303b75e Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 29 Feb 2016 20:58:42 +0100 Subject: [PATCH] Don't let dependant plugins automatically enable plugins which should be disabled by default Follow-up to f10440b and c0a7fdc --- lib/AbstractPicoPlugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index 4ec5dab..4ee337e 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -78,8 +78,13 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface if (is_array($pluginConfig) && isset($pluginConfig['enabled'])) { $this->setEnabled($pluginConfig['enabled']); } elseif ($this->enabled) { - // make sure dependencies are fulfilled - $this->checkDependencies(true); + // make sure dependencies are already fulfilled, + // otherwise the plugin needs to be enabled manually + try { + $this->checkDependencies(false); + } catch (RuntimeException $e) { + $this->enabled = false; + } } } }