MINOR PHP Notice bugfix in TableField

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82096 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-17 02:27:13 +00:00
parent 946025adb9
commit 77ab3e6038

View File

@ -265,6 +265,8 @@ class TableField extends TableListField {
function saveInto(DataObject $record) {
// CMS sometimes tries to set the value to one.
if(is_array($this->value)){
$newFields = array();
// Sort into proper array
$value = ArrayLib::invert($this->value);
$dataObjects = $this->sortData($value, $record->ID);
@ -279,7 +281,7 @@ class TableField extends TableListField {
$savedObjIds = $this->saveData($dataObjects, $this->editExisting);
// Save newly added record
if($savedObjIds || (isset($newFields) && $newFields)) {
if($savedObjIds || $newFields) {
$savedObjIds = $this->saveData($newFields,false);
}