mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed MoneyField constructor - parent (FormField) constructor calls setValue() already, which needs to happen *after* setting certain field instances (from r99391)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102861 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
498c075ece
commit
568f0d34bc
@ -29,12 +29,11 @@ class MoneyField extends FormField {
|
|||||||
protected $fieldCurrency = null;
|
protected $fieldCurrency = null;
|
||||||
|
|
||||||
function __construct($name, $title = null, $value = "", $form = null) {
|
function __construct($name, $title = null, $value = "", $form = null) {
|
||||||
parent::__construct($name, $title, $value, $form);
|
|
||||||
|
|
||||||
// naming with underscores to prevent values from actually being saved somewhere
|
// naming with underscores to prevent values from actually being saved somewhere
|
||||||
$this->fieldAmount = new NumericField("{$name}[Amount]", _t('MoneyField.FIELDLABELAMOUNT', 'Amount'));
|
$this->fieldAmount = new NumericField("{$name}[Amount]", _t('MoneyField.FIELDLABELAMOUNT', 'Amount'));
|
||||||
$this->fieldCurrency = $this->FieldCurrency();
|
$this->fieldCurrency = $this->FieldCurrency();
|
||||||
$this->setValue($value);
|
|
||||||
|
parent::__construct($name, $title, $value, $form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user