BUGFIX Fixed DataObject::fieldLabels() to detect labels on inherited database fields

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60726 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-08-14 04:43:47 +00:00
parent 4dc20e699d
commit 125ca5801b

View File

@ -2424,8 +2424,8 @@ class DataObject extends ViewableData implements DataObjectInterface {
public function fieldLabels($fieldName = false) {
$customLabels = $this->stat('field_labels');
$autoLabels = array();
if($this->databaseFields()){
foreach($this->databaseFields() as $name => $type) {
if($this->inheritedDatabaseFields()){
foreach($this->inheritedDatabaseFields() as $name => $type) {
$autoLabels[$name] = FormField::name_to_label($name);
}
$labels = array_merge((array)$autoLabels, (array)$customLabels);