From 8c88519d9f7dbea6c4ab7c60b943e32137da861a Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 8 Jan 2009 01:07:09 +0000 Subject: [PATCH] BUGFIX Fixed use of undefined constant error, and undefined variable error in TableField stopping CMS user from adding records to a TableField git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69870 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TableField.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forms/TableField.php b/forms/TableField.php index 73972c664..a3495feb9 100644 --- a/forms/TableField.php +++ b/forms/TableField.php @@ -233,7 +233,7 @@ class TableField extends TableListField { foreach($newitems as $k => $newitem){ $fieldset = $this->FieldSetForRow(); if($fieldset){ - $newitem[ID] = "new".$k; + $newitem['ID'] = "new".$k; foreach($newitem as $k => $v){ if($this->extraData && array_key_exists($k, $this->extraData)){ unset($newitem[$k]); @@ -563,7 +563,8 @@ JS; } } - function validate($validator){ + function validate($validator) { + $errorMessage = ''; $valid = true; $fields = $this->SubmittedFieldSet($sourceItemsNew); $fields = new FieldSet($fields);