mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merged revisions 52293 via svnmerge from
http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2 ........ r52293 | aoneil | 2008-04-08 12:03:43 +1200 (Tue, 08 Apr 2008) | 2 lines don't cache in overridden instance_get(), as the fields are different for subclasses ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
88d79d1b62
commit
091c0afc2e
@ -486,19 +486,18 @@ class File extends DataObject {
|
||||
|
||||
// Work out which columns we're actually going to select
|
||||
// In short, we select everything except File.Content
|
||||
$filteredSelect = array();
|
||||
foreach($query->select as $i => $item) {
|
||||
$dataobject_select = array();
|
||||
foreach($query->select as $item) {
|
||||
if($item == "`File`.*") {
|
||||
if(!isset(self::$cache_file_fields)) self::$cache_file_fields = DB::query("SHOW FIELDS IN `File`")->column();
|
||||
$columnsToAdd = array_diff(self::$cache_file_fields, $excludeDbColumns);
|
||||
foreach($columnsToAdd as $otherItem) {
|
||||
$filteredSelect[] = '`File`.' . $otherItem;
|
||||
}
|
||||
$fileColumns = DB::query("SHOW FIELDS IN `File`")->column();
|
||||
$columnsToAdd = array_diff($fileColumns, $excludeDbColumns);
|
||||
foreach($columnsToAdd as $otherItem) $dataobject_select[] = '`File`.' . $otherItem;
|
||||
} else {
|
||||
$filteredSelect[] = $item;
|
||||
$dataobject_select[] = $item;
|
||||
}
|
||||
}
|
||||
$query->select = $filteredSelect;
|
||||
|
||||
$query->select = $dataobject_select;
|
||||
|
||||
$records = $query->execute();
|
||||
$ret = $this->buildDataObjectSet($records, $containerClass);
|
||||
|
Loading…
x
Reference in New Issue
Block a user