mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fix Money::setValue() using old api
This commit is contained in:
parent
bdb312c665
commit
75c5134bc9
@ -102,7 +102,7 @@ class Money extends DBField implements CompositeDBField {
|
||||
|
||||
function setValue($value, $record = null, $markChanged = true) {
|
||||
// @todo Allow resetting value to NULL through Money $value field
|
||||
if ($value instanceof Money && $value->hasValue()) {
|
||||
if ($value instanceof Money && $value->exists()) {
|
||||
$this->setCurrency($value->getCurrency(), $markChanged);
|
||||
$this->setAmount($value->getAmount(), $markChanged);
|
||||
if($markChanged) $this->isChanged = true;
|
||||
|
Loading…
Reference in New Issue
Block a user