mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Escaping added database columns in queries for TableListField
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63618 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a672459973
commit
82d6b7e640
@ -436,7 +436,7 @@ JS
|
||||
$SNG = singleton($this->sourceClass);
|
||||
foreach($this->FieldList() as $k=>$title){
|
||||
if(!$SNG->hasField($k) && !$SNG->hasMethod('get' . $k) && !$SNG->hasMethod($k) && !strpos($k, "."))
|
||||
$query->select[] = $k;
|
||||
$query->select[] = "`$k`";
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ JS
|
||||
// Add more selected fields if they are from joined table.
|
||||
foreach($this->FieldList() as $k=>$title){
|
||||
if(singleton($this->sourceClass)->hasDatabaseField($k))
|
||||
$query->select[] = $k;
|
||||
$query->select[] = "`$k`";
|
||||
}
|
||||
}
|
||||
return clone $query;
|
||||
|
Loading…
x
Reference in New Issue
Block a user