mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
946025adb9
commit
77ab3e6038
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user