From 0d1f39ff88347171f9074613d48cac81b5e87b2b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 16 Dec 2009 05:49:14 +0000 Subject: [PATCH] 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 --- forms/TableListField.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forms/TableListField.php b/forms/TableListField.php index 997891276..f92fe4a62 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -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; }