aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php6
-rw-r--r--engine/lib/metastrings.php6
-rw-r--r--engine/lib/river.php12
-rw-r--r--engine/lib/tags.php5
4 files changed, 14 insertions, 15 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index cea8af1da..abf7395e7 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -846,9 +846,6 @@ function elgg_get_entities(array $options = array()) {
$wheres[] = elgg_get_entity_time_where_sql('e', $options['created_time_upper'],
$options['created_time_lower'], $options['modified_time_upper'], $options['modified_time_lower']);
- // remove identical where clauses
- $wheres = array_unique($wheres);
-
// see if any functions failed
// remove empty strings on successful functions
foreach ($wheres as $i => $where) {
@@ -859,6 +856,9 @@ function elgg_get_entities(array $options = array()) {
}
}
+ // remove identical where clauses
+ $wheres = array_unique($wheres);
+
// evaluate join clauses
if (!is_array($options['joins'])) {
$options['joins'] = array($options['joins']);
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index d444121d0..8c00fb2ad 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -360,9 +360,6 @@ function elgg_get_metastring_based_objects($options) {
$wheres[] = elgg_get_guid_based_where_sql('n_table.owner_guid',
$options['metastring_owner_guids']);
- // remove identical where clauses
- $wheres = array_unique($wheres);
-
// see if any functions failed
// remove empty strings on successful functions
foreach ($wheres as $i => $where) {
@@ -373,6 +370,9 @@ function elgg_get_metastring_based_objects($options) {
}
}
+ // remove identical where clauses
+ $wheres = array_unique($wheres);
+
// evaluate join clauses
if (!is_array($options['joins'])) {
$options['joins'] = array($options['joins']);
diff --git a/engine/lib/river.php b/engine/lib/river.php
index a11e6145c..e283c0595 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -170,9 +170,6 @@ function elgg_delete_river(array $options = array()) {
$wheres[] = "rv.posted <= {$options['posted_time_upper']}";
}
- // remove identical where clauses
- $wheres = array_unique($wheres);
-
// see if any functions failed
// remove empty strings on successful functions
foreach ($wheres as $i => $where) {
@@ -183,6 +180,9 @@ function elgg_delete_river(array $options = array()) {
}
}
+ // remove identical where clauses
+ $wheres = array_unique($wheres);
+
$query = "DELETE rv.* FROM {$CONFIG->dbprefix}river rv ";
// remove identical join clauses
@@ -304,9 +304,6 @@ function elgg_get_river(array $options = array()) {
}
}
- // remove identical where clauses
- $wheres = array_unique($wheres);
-
// see if any functions failed
// remove empty strings on successful functions
foreach ($wheres as $i => $where) {
@@ -317,6 +314,9 @@ function elgg_get_river(array $options = array()) {
}
}
+ // remove identical where clauses
+ $wheres = array_unique($wheres);
+
if (!$options['count']) {
$query = "SELECT DISTINCT rv.* FROM {$CONFIG->dbprefix}river rv ";
} else {
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 1116d63f3..64feed5b2 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -184,9 +184,6 @@ function elgg_get_tags(array $options = array()) {
$wheres[] = elgg_get_entity_time_where_sql('e', $options['created_time_upper'],
$options['created_time_lower'], $options['modified_time_upper'], $options['modified_time_lower']);
- // remove identical where clauses
- $wheres = array_unique($wheres);
-
// see if any functions failed
// remove empty strings on successful functions
foreach ($wheres as $i => $where) {
@@ -197,6 +194,8 @@ function elgg_get_tags(array $options = array()) {
}
}
+ // remove identical where clauses
+ $wheres = array_unique($wheres);
$joins = $options['joins'];