Changeset 376

Show
Ignore:
Timestamp:
07/01/09 16:44:19 (5 months ago)
Author:
bettse
Message:

sql corrections to a group by and order by clause in annotations.php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • elgg/branches/elgg1.5/engine/lib/annotations.php

    r361 r376  
    680680                $query .= get_access_sql_suffix("a"); // now add access 
    681681                $query .= ' and ' . get_access_sql_suffix("e"); // now add access 
    682                 if (!$count) $query .= ' group by e.guid'; 
     682                if (!$count) $query .= ' group by e.guid, e.type, e.subtype, e.owner_guid, e.site_guid, e.container_guid, e.access_id, e.time_created, e.time_modified, e.enabled '; 
    683683                 
    684684                if (!$count) { 
    685                         $query .= ' order by sum ' . $orderdir; 
     685                        $query .= ' order by count(msvalue.id) ' . $orderdir; 
    686686            $query .= ' limit ' . $limit . ' offset ' . $offset; 
    687687                        return get_data($query, "entity_row_to_elggstar");