BUGFIX: not all decorators has a summary_fields defined, so the code need to deal with this.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61975 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2008-09-04 23:10:20 +00:00
parent 770bdfa42b
commit 66b6a32c8d

View File

@ -114,15 +114,19 @@ abstract class DataObjectDecorator extends Extension {
*/ */
function updateSummaryFields(&$fields){ function updateSummaryFields(&$fields){
$extra_fields = $this->extraDBFields(); $extra_fields = $this->extraDBFields();
if(isset($extra_fields['summary_fields'])){
$summary_fields = $extra_fields['summary_fields']; $summary_fields = $extra_fields['summary_fields'];
if($summary_fields) $fields = array_merge($fields, $summary_fields); if($summary_fields) $fields = array_merge($fields, $summary_fields);
} }
}
function updateSummaryFieldsExcludeExtra(&$fields){ function updateSummaryFieldsExcludeExtra(&$fields){
$extra_fields = $this->extraDBFields(); $extra_fields = $this->extraDBFields();
if(isset($extra_fields['summary_fields'])){
$summary_fields = $extra_fields['summary_fields']; $summary_fields = $extra_fields['summary_fields'];
if($summary_fields)$fields = array_merge($fields, $summary_fields); if($summary_fields)$fields = array_merge($fields, $summary_fields);
} }
} }
}
?> ?>