MINOR: Fix PHP notices

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@64625 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-10-22 02:52:04 +00:00 committed by Sam Minnee
parent 226f7b230e
commit a7bc06c656

View File

@ -268,14 +268,14 @@ class TableField extends TableListField {
// Sort into proper array // Sort into proper array
$this->value = ArrayLib::invert($this->value); $this->value = ArrayLib::invert($this->value);
$dataObjects = $this->sortData($this->value, $record->ID); $dataObjects = $this->sortData($this->value, $record->ID);
if($dataObjects['new']) { if(isset($dataObjects['new']) && $dataObjects['new']) {
$newFields = $this->sortData($dataObjects['new'], $record->ID); $newFields = $this->sortData($dataObjects['new'], $record->ID);
} }
$savedObj = $this->saveData($dataObjects, $this->editExisting); $savedObj = $this->saveData($dataObjects, $this->editExisting);
if($savedObj && $newFields) { if($savedObj && isset($newFields)) {
$savedObj += $this->saveData($newFields,false); $savedObj += $this->saveData($newFields,false);
} else if($newFields) { } else if(isset($newFields)) {
$savedObj = $this->saveData($newFields,false); $savedObj = $this->saveData($newFields,false);
} }
$items = $this->sourceItems(); $items = $this->sourceItems();
@ -778,4 +778,4 @@ class TableField_Item extends TableListField_Item {
} }
?> ?>