mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Issue #2766 - Moves logic to return ReadonlyField versions of MoneyFields child fields to performReadonlyTransformation() method and reverts changes to MoneyField::setReadonly() as per Wilr’s (https://github.com/wilr) request
This commit is contained in:
parent
611d571b65
commit
405426799b
@ -120,6 +120,8 @@ class MoneyField extends FormField {
|
||||
*/
|
||||
public function performReadonlyTransformation() {
|
||||
$clone = clone $this;
|
||||
$clone->fieldAmount = $clone->fieldAmount->performReadonlyTransformation();
|
||||
$clone->fieldCurrency = $clone->fieldCurrency->performReadonlyTransformation();
|
||||
$clone->setReadonly(true);
|
||||
return $clone;
|
||||
}
|
||||
@ -131,8 +133,8 @@ class MoneyField extends FormField {
|
||||
public function setReadonly($bool) {
|
||||
parent::setReadonly($bool);
|
||||
|
||||
$this->fieldAmount = $this->fieldAmount->performReadonlyTransformation();
|
||||
$this->fieldCurrency = $this->fieldCurrency->performReadonlyTransformation();
|
||||
$this->fieldAmount->setReadonly($bool);
|
||||
$this->fieldCurrency->setReadonly($bool);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user