aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-14 22:17:34 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-14 22:17:34 +0000
commit3e699017da34b994da17978b905e985c1927cec0 (patch)
tree977232dd61d1d06426e0389bc39a4eb6a50a166b /engine/lib
parent2141b3858b032493d38c95bf538b69fbc90c4f2a (diff)
downloadelgg-3e699017da34b994da17978b905e985c1927cec0.tar.gz
elgg-3e699017da34b994da17978b905e985c1927cec0.tar.bz2
Refs #3079: Making sure elgg_get_max_plugin_priority() returns 1 instead. Fixed problems when bootstrapping elgg plugins. Will perform tests against MySQL 5.5 when I have a real internet connection.
git-svn-id: http://code.elgg.org/elgg/trunk@8706 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/plugins.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 981896588..c54c12afd 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -124,8 +124,6 @@ function elgg_generate_plugin_entities() {
return false;
}
- $new_plugin_priority = elgg_get_max_plugin_priority() + 1;
-
// check real plugins against known ones
foreach ($physical_plugins as $plugin_id) {
// is this already in the db?
@@ -136,20 +134,16 @@ function elgg_generate_plugin_entities() {
if ($plugin->enabled != 'yes') {
$plugin->enable();
$plugin->deactivate();
- $plugin->setPriority($new_plugin_priority);
-
- $new_plugin_priority++;
+ $plugin->setPriority('last');
}
// remove from the list of plugins to disable
unset($known_plugins[$index]);
} else {
// add new plugins
+ // priority is force to last in save() if not set.
$plugin = new ElggPlugin($plugin_id);
$plugin->save();
- $plugin->setPriority($new_plugin_priority);
-
- $new_plugin_priority++;
}
}
@@ -235,11 +229,11 @@ function elgg_get_max_plugin_priority() {
$data = get_data($q);
if ($data) {
- return $data[0]->max;
+ $max = $data[0]->max;
}
// can't have a priority of 0.
- return 1;
+ return ($max) ? $max : 1;
}
/**