mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Saving bug fixing with when value equals undefined
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43536 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
81d774fcf7
commit
cf7adf02da
@ -85,12 +85,13 @@ class HasOneComplexTableField extends ComplexTableField {
|
||||
function saveInto( DataObject $record ) {
|
||||
$fieldName = $this->name;
|
||||
$fieldNameID = $fieldName . 'ID';
|
||||
|
||||
if( $val = $this->value[ $this->htmlListField ] )
|
||||
$record->$fieldNameID = $val;
|
||||
else
|
||||
$record->$fieldNameID = 0;
|
||||
|
||||
|
||||
$record->$fieldNameID = 0;
|
||||
if( $val = $this->value[ $this->htmlListField ] ) {
|
||||
if( $val != 'undefined' )
|
||||
$record->$fieldNameID = $val;
|
||||
}
|
||||
|
||||
$record->write();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user