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
This commit is contained in:
Sean Harvey 2009-01-08 01:07:09 +00:00 committed by Sam Minnee
parent 263c6fa125
commit 8c88519d9f

View File

@ -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);