aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 02:05:59 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 02:05:59 +0000
commit82f7909dd08ebfea881d71fd9f2fb1d6ab798932 (patch)
tree5b35c3aa47c708bb7f606ed53fc2c2a9e484c2c6 /engine
parentd9b0196269eb808468b060461a7f84d9f6b692e9 (diff)
downloadelgg-82f7909dd08ebfea881d71fd9f2fb1d6ab798932.tar.gz
elgg-82f7909dd08ebfea881d71fd9f2fb1d6ab798932.tar.bz2
Fixes #2914. Merged fix for r.time_created sorting to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@8220 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/relationships.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 0370a1e82..4a1e4ad0f 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -277,6 +277,16 @@ function elgg_get_entities_from_relationship($options) {
}
$options['joins'] = array_merge($options['joins'], $clauses['joins']);
+
+ if (isset($options['selects']) && !is_array($options['selects'])) {
+ $options['selects'] = array($options['selects']);
+ } elseif (!isset($options['selects'])) {
+ $options['selects'] = array();
+ }
+
+ $select = array('r.*');
+
+ $options['selects'] = array_merge($options['selects'], $select);
}
return elgg_get_entities_from_metadata($options);