aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-29 12:41:12 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-29 12:41:12 +0000
commit924e9af0b1b4f81f98b9575d76e36afdb7be9ab0 (patch)
tree00832e217aa9e948c6246877243582be88105667 /engine/lib
parent64ebd09a4d00e8b425ef762d55b63fa417a8cfff (diff)
downloadelgg-924e9af0b1b4f81f98b9575d76e36afdb7be9ab0.tar.gz
elgg-924e9af0b1b4f81f98b9575d76e36afdb7be9ab0.tar.bz2
Fixed a minor SQL error in annotation sum functions
git-svn-id: https://code.elgg.org/elgg/trunk@555 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/annotations.php2
1 files changed, 1 insertions, 1 deletions
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