BUGFIX: Fix fatal error when exporting a csv from a tablefield with a custom query (from r95108)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95634 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-12-16 05:49:14 +00:00
parent b52e49dee7
commit 0d1f39ff88

View File

@ -491,10 +491,11 @@ JS
function getCsvQuery() {
$baseClass = ClassInfo::baseDataClass($this->sourceClass);
if($this->customCsvQuery || $this->customQuery) {
$query = $this->customCsvQuery;
$query = $this->customCsvQuery ? $this->customCsvQuery : $this->customQuery;
} else {
$query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, null, $this->sourceJoin);
}
return clone $query;
}