From 63c543c18dd42eaa2263594f202efed4b1ccad30 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 17 Feb 2010 00:43:12 +0000 Subject: [PATCH] BUGFIX Fixed MoneyField constructor - parent (FormField) constructor calls setValue() already, which needs to happen *after* setting certain field instances git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99391 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/MoneyField.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forms/MoneyField.php b/forms/MoneyField.php index a05aee479..d582cf7e9 100644 --- a/forms/MoneyField.php +++ b/forms/MoneyField.php @@ -29,12 +29,11 @@ class MoneyField extends FormField { protected $fieldCurrency = 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 $this->fieldAmount = new NumericField("{$name}[Amount]", _t('MoneyField.FIELDLABELAMOUNT', 'Amount')); $this->fieldCurrency = $this->FieldCurrency(); - $this->setValue($value); + + parent::__construct($name, $title, $value, $form); } /**