aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-13 19:33:03 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-13 19:33:03 +0000
commitcb0ebb459d7b75d4344398742a96d7910aa7119b (patch)
treeb96ad06c6bc028ff8658d9938aa8682925cea554
parent5d373e98648601288acd68c4315b31c381acc1e5 (diff)
downloadelgg-cb0ebb459d7b75d4344398742a96d7910aa7119b.tar.gz
elgg-cb0ebb459d7b75d4344398742a96d7910aa7119b.tar.bz2
Refs #3079: Better checks in ElggPlugin::setPriority() to avoid priorities of 0. Still requires testing for MySQL 5.5.
git-svn-id: http://code.elgg.org/elgg/trunk@8693 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggPlugin.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index 18d97d23a..208d1eff8 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -177,8 +177,9 @@ class ElggPlugin extends ElggObject {
$db_prefix = get_config('dbprefix');
$name = elgg_namespace_plugin_private_setting('internal', 'priority');
- // if no priority assume a priority of 0
+ // if no priority assume a priority of 1
$old_priority = (int) $this->getPriority();
+ $old_priority = (!$old_priority) ? 1 : $old_priority;
$max_priority = elgg_get_max_plugin_priority();
// can't use switch here because it's not strict and
@@ -194,7 +195,7 @@ class ElggPlugin extends ElggObject {
}
// should be a number by now
- if ($priority) {
+ if ($priority > 0) {
if (!is_numeric($priority)) {
return false;
}
@@ -234,7 +235,6 @@ class ElggPlugin extends ElggObject {
// set this priority
if ($this->set($name, $priority)) {
- //return elgg_plugins_reindex_priorities();
return true;
} else {
return false;