From e60d45a1e8025a10220a42285d3ff17335af5214 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 14 Apr 2011 23:06:51 +0000 Subject: Refs #3195. Changed the way annotation calculations are performed. Seems to be working better, but will want to test more before closing. git-svn-id: http://code.elgg.org/elgg/trunk@9000 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/metastrings.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engine/lib/metastrings.php') diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php index 913d33a7d..604c7f765 100644 --- a/engine/lib/metastrings.php +++ b/engine/lib/metastrings.php @@ -406,8 +406,18 @@ function elgg_get_metastring_based_objects($options) { } if ($options['metastring_calculation'] === ELGG_ENTITIES_NO_VALUE) { + // evalutate selects + if ($options['selects']) { + $selects = ''; + foreach ($options['selects'] as $select) { + $selects .= ", $select"; + } + } else { + $selects = ''; + } + $query = "SELECT DISTINCT n_table.*, n.string as name, - v.string as value FROM {$db_prefix}$type n_table"; + v.string as value{$selects} FROM {$db_prefix}$type n_table"; } else { $query = "SELECT {$options['metastring_calculation']}(v.string) as calculation FROM {$db_prefix}$type n_table"; } -- cgit v1.2.3