From 933468aa8c3876a513a66922a3ee755a36c86378 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Mon, 18 May 2009 03:48:50 +0000 Subject: [PATCH] Fix a PHP segfault git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77051 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TableListField.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/forms/TableListField.php b/forms/TableListField.php index 007250154..2310c3c3f 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -1222,8 +1222,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; @@ -1237,6 +1237,7 @@ class TableListField_Item extends ViewableData { } } } + // casting if(array_key_exists($fieldName, $this->parent->fieldCasting)) { $value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]); @@ -1257,6 +1258,7 @@ class TableListField_Item extends ViewableData { $value = str_replace($search, $replace, $value); } } + $fields[] = new ArrayData(array( "Name" => $fieldName, @@ -1431,4 +1433,4 @@ class TableListField_ItemRequest extends RequestHandler { return false; } } -?> \ No newline at end of file +?>