BUGFIX: orderby clause not necessary for simple count queries, and will break MSSQL

This commit is contained in:
Geoff Munn 2009-08-11 21:09:31 +00:00
parent 5406ab5b60
commit 9e9cf9a4c2

View File

@ -57,7 +57,9 @@ class FileSubsites extends DataObjectDecorator {
break;
}
$query->orderby = 'SubsiteID' . ($query->orderby ? ', ' : '') . $query->orderby;
if(sizeof($query->select)>1 || $query->select[0]!='COUNT(*)'){
$query->orderby = 'SubsiteID' . ($query->orderby ? ', ' : '') . $query->orderby;
}
}
}