Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77066 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-05-18 05:30:26 +00:00
parent 2fc1771f93
commit 619c570801

View File

@ -1242,7 +1242,7 @@ class TableListField_Item extends ViewableData {
// This supports simple FieldName syntax // This supports simple FieldName syntax
if(strpos($fieldName,'.') === false) { if(strpos($fieldName,'.') === false) {
$value = ($this->item->val($fieldName)) ? $this->item->val($fieldName) : $this->item->$fieldName; $value = ($this->item->XML_val($fieldName)) ? $this->item->XML_val($fieldName) : $this->item->$fieldName;
// This support the syntax fieldName = Relation.RelatedField // This support the syntax fieldName = Relation.RelatedField
} else { } else {
$fieldNameParts = explode('.', $fieldName) ; $fieldNameParts = explode('.', $fieldName) ;
@ -1257,6 +1257,7 @@ class TableListField_Item extends ViewableData {
} }
} }
} }
// casting // casting
if(array_key_exists($fieldName, $this->parent->fieldCasting)) { if(array_key_exists($fieldName, $this->parent->fieldCasting)) {
$value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]); $value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]);
@ -1278,6 +1279,7 @@ class TableListField_Item extends ViewableData {
} }
} }
$fields[] = new ArrayData(array( $fields[] = new ArrayData(array(
"Name" => $fieldName, "Name" => $fieldName,
"Title" => $fieldTitle, "Title" => $fieldTitle,