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); }