From 0b68356854cb3422b8cc8af6b81a2140b9b9e924 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 19 Nov 2007 01:26:49 +0000 Subject: [PATCH] parents-merge 35012 - Form::loadDataFrom() didn't like fields called 'Name' git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@45049 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/Form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forms/Form.php b/forms/Form.php index e4336ae53..b9819c966 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -488,7 +488,8 @@ class Form extends ViewableData { if($name = $field->Name()) { if($o) { - $val = $object->$name; + // this was failing with the field named 'Name' + $val = $object->getField($name); } else { $val = isset($object[$name]) ? $object[$name] : null; }