mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Updated BankAccountField to allow setting it to blank without a notice-level error
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63552 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7574120f15
commit
6694936cc8
@ -60,14 +60,15 @@ class BankAccountField extends FormField {
|
||||
|
||||
public function setValue($value) {
|
||||
$this->value = self::join_bank_number($value);
|
||||
|
||||
$this->valueArr = array();
|
||||
list(
|
||||
$this->valueArr['BankCode'],
|
||||
$this->valueArr['BranchCode'],
|
||||
$this->valueArr['AccountNumber'],
|
||||
$this->valueArr['AccountSuffix']
|
||||
) = explode(" ",$this->value);
|
||||
if($this->value) {
|
||||
$this->valueArr = array();
|
||||
list(
|
||||
$this->valueArr['BankCode'],
|
||||
$this->valueArr['BranchCode'],
|
||||
$this->valueArr['AccountNumber'],
|
||||
$this->valueArr['AccountSuffix']
|
||||
) = explode(" ",$this->value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,6 +109,7 @@ class BankAccountField extends FormField {
|
||||
public static function join_bank_number($value) {
|
||||
if(is_array($value)) {
|
||||
$value = self::convert_format_nz($value);
|
||||
$completeNumber = "";
|
||||
if($value['BankCode']) {
|
||||
$completeNumber .= $value['BankCode'] . " ";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user