mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-02 22:28:37 +02:00
ENHANCEMENT: Improve TableListField query generation, so that it checks whether the DataObject has a database field, rather than just checking to see if it *doesn't* have a field or method.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78153 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f8fff9709d
commit
30517119d4
@ -460,13 +460,12 @@ JS
|
||||
$query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, null, $this->sourceJoin);
|
||||
|
||||
// Add more selected fields if they are from joined table.
|
||||
|
||||
$SNG = singleton($this->sourceClass);
|
||||
foreach($this->FieldList() as $k=>$title){
|
||||
if(!$SNG->hasField($k) && !$SNG->hasMethod('get' . $k) && !$SNG->hasMethod($k) && !strpos($k, "."))
|
||||
foreach($this->FieldList() as $k => $title) {
|
||||
if(!strpos($k, '.') && singleton($this->sourceClass)->hasDatabaseField($k)) {
|
||||
$query->select[] = "\"$k\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
|
||||
$SQL_sort = Convert::raw2sql($_REQUEST['ctf'][$this->Name()]['sort']);
|
||||
|
Loading…
Reference in New Issue
Block a user