mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: orderby clause not necessary for simple count queries, and will break MSSQL
This commit is contained in:
parent
5406ab5b60
commit
9e9cf9a4c2
@ -57,9 +57,11 @@ class FileSubsites extends DataObjectDecorator {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sizeof($query->select)>1 || $query->select[0]!='COUNT(*)'){
|
||||||
$query->orderby = 'SubsiteID' . ($query->orderby ? ', ' : '') . $query->orderby;
|
$query->orderby = 'SubsiteID' . ($query->orderby ? ', ' : '') . $query->orderby;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function augmentBeforeWrite() {
|
function augmentBeforeWrite() {
|
||||||
if(!$this->owner->ID && !$this->owner->SubsiteID) $this->owner->SubsiteID = Subsite::currentSubsiteID();
|
if(!$this->owner->ID && !$this->owner->SubsiteID) $this->owner->SubsiteID = Subsite::currentSubsiteID();
|
||||||
|
Loading…
Reference in New Issue
Block a user