From 7f7e3a0ba33eae4a66bfe725dea9e0c0ca093647 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 21 Oct 2009 02:36:33 +0000 Subject: [PATCH] API CHANGE: TableListField customQuery and customCsvQuery won't automatically include ID, ClassName, and RecordClassName fields (from r87354) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89726 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TableListField.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/forms/TableListField.php b/forms/TableListField.php index 840e19f57..1e2720c30 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -472,9 +472,6 @@ JS if($this->customQuery) { $query = clone $this->customQuery; $baseClass = ClassInfo::baseDataClass($this->sourceClass); - $query->select[] = "\"{$baseClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"RecordClassName\""; } else { $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, null, $this->sourceJoin); } @@ -493,16 +490,8 @@ JS function getCsvQuery() { $baseClass = ClassInfo::baseDataClass($this->sourceClass); - if($this->customCsvQuery) { + if($this->customCsvQuery || $this->customQuery) { $query = $this->customCsvQuery; - $query->select[] = "\"{$baseClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"RecordClassName\""; - } else if($this->customQuery) { - $query = $this->customQuery; - $query->select[] = "\"{$baseClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$baseClass}\".\"ClassName\" AS \"RecordClassName\""; } else { $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, null, $this->sourceJoin); }