mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed DataObject->write() for CompositeDBFields - wasn't calling setValue() on those fields, which meant that CompositeDBFields like Money were overwriting the values set in DataObject::$record (e.g. "MoneyCurrency" for a "Money" field) with empty values through CompositeDBField->addToManipulation(), as the dbfield itself doesn't have any values.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77640 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ee072565ec
commit
265b4184f7
@ -877,11 +877,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
$fieldObj = DBField::create('Varchar', $this->record[$fieldName], $fieldName);
|
||||
}
|
||||
|
||||
// CompositeDBFields handle their own value storage; regular fields need to be
|
||||
// re-populated from the database
|
||||
if(!$fieldObj instanceof CompositeDBField) {
|
||||
// Both CompositeDBFields and regular fields need to be repopulated
|
||||
$fieldObj->setValue($this->record[$fieldName], $this->record);
|
||||
}
|
||||
|
||||
if($class != $baseTable || $fieldName!='ID')
|
||||
$fieldObj->writeToManipulation($manipulation[$class]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user