From 9a68be3c337ed98475535ab6b0483f53073678e1 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 24 May 2011 17:59:51 +0000 Subject: 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 --- engine/classes/ElggPluginPackage.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'engine/classes/ElggPluginPackage.php') 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' -- cgit v1.2.3