aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/classes/ElggPlugin.php1
-rw-r--r--engine/classes/ElggPluginManifest.php16
-rw-r--r--engine/lib/plugins.php12
3 files changed, 25 insertions, 4 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index fb9138ab9..eac98da57 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -83,6 +83,7 @@ class ElggPlugin extends ElggObject {
$this->manifest = $this->package->getManifest();
} catch (Exception $e) {
// we always have to allow the entity to load.
+ elgg_log("Failed to load $this->guid as a plugin. " . $e->getMessage(), 'WARNING');
}
}
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 9fcdaaf55..290a59a0c 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -330,7 +330,12 @@ class ElggPluginManifest {
* @return array
*/
public function getProvides() {
- $provides = $this->parser->getAttribute('provides');
+ // normalize for 1.7
+ if ($this->getApiVersion() < 1.8) {
+ $provides = array();
+ } else {
+ $provides = $this->parser->getAttribute('provides');
+ }
if (!$provides) {
$provides = array();
@@ -370,6 +375,8 @@ class ElggPluginManifest {
'comparison' => 'ge'
)
);
+ } else {
+ $reqs = array();
}
} else {
$reqs = $this->parser->getAttribute('requires');
@@ -465,7 +472,12 @@ class ElggPluginManifest {
* @return array
*/
public function getConflicts() {
- $conflicts = $this->parser->getAttribute('conflicts');
+ // normalize for 1.7
+ if ($this->getApiVersion() < 1.8) {
+ $conflicts = array();
+ } else {
+ $conflicts = $this->parser->getAttribute('conflicts');
+ }
if (!$conflicts) {
$conflicts = array();
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index cd74353de..b48f1c670 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -136,6 +136,9 @@ function elgg_generate_plugin_entities() {
if ($plugin->enabled != 'yes') {
$plugin->enable();
$plugin->deactivate();
+ $plugin->setPriority($new_plugin_priority);
+
+ $new_plugin_priority++;
}
// remove from the list of plugins to disable
@@ -154,8 +157,13 @@ function elgg_generate_plugin_entities() {
// because they are entities, but their dirs were removed.
// don't delete the entities because they hold settings.
foreach ($known_plugins as $plugin) {
- $plugin->deactivate();
- $plugin->disable();
+ if ($plugin->isActive()) {
+ $plugin->deactivate();
+ // remove the priority.
+ $name = elgg_namespace_plugin_private_setting('internal', 'priority');
+ remove_private_setting($plugin->guid, $name);
+ $plugin->disable();
+ }
}
access_show_hidden_entities($old_access);