Browse Source

Check dependencies when a plugin is enabled by default

Daniel Rudolf 9 years ago
parent
commit
f10440b
2 changed files with 10 additions and 0 deletions
  1. 7 0
      CHANGELOG.md
  2. 3 0
      lib/AbstractPicoPlugin.php

+ 7 - 0
CHANGELOG.md

@@ -1,6 +1,13 @@
 Pico Changelog
 Pico Changelog
 ==============
 ==============
 
 
+### Version 1.0.2
+Released: -
+
+```
+* [Fixed] Check dependencies when a plugin is enabled by default
+```
+
 ### Version 1.0.1
 ### Version 1.0.1
 Released: 2016-02-27
 Released: 2016-02-27
 
 

+ 3 - 0
lib/AbstractPicoPlugin.php

@@ -77,6 +77,9 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
                 $pluginConfig = $this->getConfig(get_called_class());
                 $pluginConfig = $this->getConfig(get_called_class());
                 if (is_array($pluginConfig) && isset($pluginConfig['enabled'])) {
                 if (is_array($pluginConfig) && isset($pluginConfig['enabled'])) {
                     $this->setEnabled($pluginConfig['enabled']);
                     $this->setEnabled($pluginConfig['enabled']);
+                } else {
+                    // make sure dependencies are checked
+                    $this->setEnabled($this->enabled, true, true);
                 }
                 }
             }
             }
         }
         }