Index: /elgg/branches/elgg1.5-sql-fixes/engine/lib/tags.php =================================================================== --- /elgg/branches/elgg1.5-sql-fixes/engine/lib/tags.php (revision 268) +++ /elgg/branches/elgg1.5-sql-fixes/engine/lib/tags.php (revision 379) @@ -137,5 +137,5 @@ $query .= ' and ' . get_access_sql_suffix("e"); // Add access controls - $query .= " group by msvalue.string having total > {$threshold} order by total desc limit {$limit} "; + $query .= " group by msvalue.string having count(msvalue.id) > {$threshold} order by count(msvalue.id) desc limit {$limit} "; return get_data($query);