mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Don't select *any* column() in DataQuery::initialiseQuery(); leave that until finaliseQuery(). It shouldn't be necessary and just risks field collisions.
This commit is contained in:
parent
8661164c19
commit
5abf8cf0f3
@ -105,7 +105,6 @@ class DataQuery {
|
||||
}
|
||||
|
||||
$baseClass = array_shift($tableClasses);
|
||||
$select = array("\"$baseClass\".*");
|
||||
|
||||
// Build our intial query
|
||||
$this->query = new SQLQuery(array());
|
||||
@ -116,7 +115,6 @@ class DataQuery {
|
||||
}
|
||||
|
||||
$this->query->from("\"$baseClass\"");
|
||||
$this->selectColumnsFromTable($this->query, $baseClass);
|
||||
|
||||
singleton($this->dataClass)->extend('augmentDataQueryCreation', $this->query, $this);
|
||||
}
|
||||
@ -155,12 +153,6 @@ class DataQuery {
|
||||
$tableNames = array_keys($tableClasses);
|
||||
$baseClass = $tableNames[0];
|
||||
|
||||
// Empty the existing select query of all non-generated selects (eg, random sorts and many-many-extrafields).
|
||||
// Maybe we should remove all fields that exist on this class instead?
|
||||
foreach ($query->select as $name => $column) {
|
||||
if (!is_numeric($name)) unset($query->select[$name]);
|
||||
}
|
||||
|
||||
// Iterate over the tables and check what we need to select from them. If any selects are made (or the table is
|
||||
// required for a select)
|
||||
foreach($tableClasses as $tableClass) {
|
||||
|
Loading…
Reference in New Issue
Block a user