diff --git a/code/FileSubsites.php b/code/FileSubsites.php index 1e20b1f..6934c86 100755 --- a/code/FileSubsites.php +++ b/code/FileSubsites.php @@ -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; + } } }