aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-18 15:34:15 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-18 15:34:15 +0000
commitbd9aca40946dfd3907d22e3247c698eba48e01d2 (patch)
tree25ae4ddde834d3e714d5654f03daed6e5bc4d63f
parentf4ad8cd96810bf5f1a1a4db9270f7924dbbb0fc4 (diff)
downloadelgg-bd9aca40946dfd3907d22e3247c698eba48e01d2.tar.gz
elgg-bd9aca40946dfd3907d22e3247c698eba48e01d2.tar.bz2
Fixes #2945, Refs #2946. Plugins that require priority on an uninstalled plugin don't crash the plugins admin.
git-svn-id: http://code.elgg.org/elgg/trunk@8283 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggPluginPackage.php12
-rw-r--r--languages/en.php1
2 files changed, 12 insertions, 1 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index e1b3427cc..567ec129f 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -438,7 +438,7 @@ class ElggPluginPackage {
* @return bool
*/
private function checkDepPriority(array $dep, array $plugins, $inverse = false) {
- // see if we exist as an ElggPlugin
+ // grab the ElggPlugin using this package.
$this_plugin = elgg_get_plugin_from_id($this->getID());
$this_priority = $this_plugin->getPriority();
@@ -448,6 +448,16 @@ class ElggPluginPackage {
}
}
+ // If this isn't a plugin or there are no active plugins,
+ // we can't satisfy this dep.
+ // Assume everything is ok. See #2946.
+ if (!$this->plugin || !$plugins) {
+ return array(
+ 'status' => true,
+ 'value' => 'uninstalled'
+ );
+ }
+
$test_plugin_priority = $test_plugin->getPriority();
switch ($dep['priority']) {
diff --git a/languages/en.php b/languages/en.php
index 99107b464..e1eed9996 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -96,6 +96,7 @@ $english = array(
'ElggPlugin:Dependencies:Plugin' => 'Plugin: %s',
'ElggPlugin:Dependencies:Priority:After' => 'After %s',
'ElggPlugin:Dependencies:Priority:Before' => 'Before %s',
+ 'ElggPlugin:Dependencies:Priority:Uninstalled' => '%s is not installed',
'ElggPlugin:Dependencies:Suggests:Unsatisfied' => 'Missing',