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,8 +1242,8 @@ class TableListField_Item extends ViewableData {
// This supports simple FieldName syntax
if(strpos($fieldName,'.') === false) {
$value = ($this->item->val($fieldName)) ? $this->item->val($fieldName) : $this->item->$fieldName;
// This support the syntax fieldName = Relation.RelatedField
$value = ($this->item->XML_val($fieldName)) ? $this->item->XML_val($fieldName) : $this->item->$fieldName;
// This support the syntax fieldName = Relation.RelatedField
} else {
$fieldNameParts = explode('.', $fieldName) ;
$tmpItem = $this->item;
@ -1257,6 +1257,7 @@ class TableListField_Item extends ViewableData {
}
}
}
// casting
if(array_key_exists($fieldName, $this->parent->fieldCasting)) {
$value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]);
@ -1277,6 +1278,7 @@ class TableListField_Item extends ViewableData {
$value = str_replace($search, $replace, $value);
}
}
$fields[] = new ArrayData(array(
"Name" => $fieldName,
@ -1471,4 +1473,4 @@ class TableListField_ItemRequest extends RequestHandler {
return false;
}
}
?>
?>