BUG corrects MoneyField::setReadonly() method in order to return ReadonlyField instances of its child fields

Issue #2766 - This causes our cloned MoneyField to actually contain two ReadonlyFields for currency and amount.
This commit is contained in:
Joe Harvey 2014-01-10 15:35:45 +00:00
parent 6fae1e6392
commit 611d571b65

View File

@ -131,8 +131,8 @@ class MoneyField extends FormField {
public function setReadonly($bool) {
parent::setReadonly($bool);
$this->fieldAmount->setReadonly($bool);
$this->fieldCurrency->setReadonly($bool);
$this->fieldAmount = $this->fieldAmount->performReadonlyTransformation();
$this->fieldCurrency = $this->fieldCurrency->performReadonlyTransformation();
return $this;
}