From 924e9af0b1b4f81f98b9575d76e36afdb7be9ab0 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 29 Apr 2008 12:41:12 +0000 Subject: Fixed a minor SQL error in annotation sum functions git-svn-id: https://code.elgg.org/elgg/trunk@555 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/annotations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/lib/annotations.php') diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 7bc1a52ee..25ee7197a 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -363,7 +363,7 @@ $where[] = "a.value_type='integer'"; // Limit on integer types - $query = "SELECT $sum(ms.string) as sum from {$CONFIG->dbprefix}annotations a JOIN {$CONFIG->dbprefix}entities e on a.entity_guid = e.guid JOIN {$CONFIG->dbprefix}metastrings ms on a.value=ms.id WHERE "; + $query = "SELECT $sum(ms.string) as sum from {$CONFIG->dbprefix}annotations a JOIN {$CONFIG->dbprefix}entities e on a.entity_guid = e.guid JOIN {$CONFIG->dbprefix}metastrings ms on a.value_id=ms.id WHERE "; foreach ($where as $w) $query .= " $w and "; $query .= " (a.access_id in {$access} or (a.access_id = 0 and a.owner_guid = {$_SESSION['id']}))"; // now add access -- cgit v1.2.3