diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-01 16:00:05 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-01 16:00:05 +0000 |
commit | 32f99430766b9d61c68880246efe9394283766c7 (patch) | |
tree | f1050a4b66db90cae93e3dae9564fa4184377f7f | |
parent | 18c9d4463fb59faa2d2f1f76c743b20b15456896 (diff) | |
download | elgg-32f99430766b9d61c68880246efe9394283766c7.tar.gz elgg-32f99430766b9d61c68880246efe9394283766c7.tar.bz2 |
Fixed a bug in countAnnotations
git-svn-id: https://code.elgg.org/elgg/trunk@610 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/annotations.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 86d6dde17..7df18e3a7 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -360,8 +360,9 @@ $where[] = "e.subtype=$entity_subtype"; if ($name!="") $where[] = "a.name_id='$name'"; - - $where[] = "a.value_type='integer'"; // Limit on integer types +
+ if ($sum != "count") + $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_id=ms.id WHERE "; foreach ($where as $w) @@ -369,7 +370,6 @@ $query .= " (a.access_id in {$access} or (a.access_id = 0 and a.owner_guid = {$_SESSION['id']}))"; // now add access $row = get_data_row($query); - if ($row) return $row->sum; |