aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginPackage.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-24 17:59:51 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-24 17:59:51 +0000
commit9a68be3c337ed98475535ab6b0483f53073678e1 (patch)
tree78f0da0350b8c5635f571ae0938cd1830dfc3fe7 /engine/classes/ElggPluginPackage.php
parent22fd09fa332ed11118e8cc81e82dd2497b874ac5 (diff)
downloadelgg-9a68be3c337ed98475535ab6b0483f53073678e1.tar.gz
elgg-9a68be3c337ed98475535ab6b0483f53073678e1.tar.bz2
Fixes #3467. Fixed bugs in priority deps. Can now disable active plugins with unmet dependencies.
git-svn-id: http://code.elgg.org/elgg/trunk@9111 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginPackage.php')
-rw-r--r--engine/classes/ElggPluginPackage.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index 9aa4af8bf..977b72d76 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -457,16 +457,11 @@ class ElggPluginPackage {
// grab the ElggPlugin using this package.
$plugin_package = elgg_get_plugin_from_id($this->getID());
$plugin_priority = $plugin_package->getPriority();
+ $test_plugin = elgg_get_plugin_from_id($dep['plugin']);
- foreach ($plugins as $test_plugin) {
- if ($test_plugin->getID() == $dep['plugin']) {
- break;
- }
- }
-
- // If this isn't a plugin or there are no active plugins,
- // we can't satisfy this dep.
- if (!$plugin_package || !$plugins) {
+ // If this isn't a plugin or the plugin isn't installed or active
+ // priority doesn't matter. Use requires to check if a plugin is active.
+ if (!$plugin_package || !$test_plugin || !$test_plugin->isActive()) {
return array(
'status' => true,
'value' => 'uninstalled'