mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.6' into 3
This commit is contained in:
commit
eec8dfa7ad
@ -58,16 +58,18 @@ class CountryDropdownField extends DropdownField {
|
||||
public function Field($properties = array()) {
|
||||
$source = $this->getSource();
|
||||
|
||||
if (!$this->value || !isset($source[$this->value])) {
|
||||
if ($this->config()->default_to_locale && $this->locale()) {
|
||||
$locale = new Zend_Locale();
|
||||
$locale->setLocale($this->locale());
|
||||
$this->value = $locale->getRegion();
|
||||
if(!$this->getHasEmptyDefault()){
|
||||
if (!$this->value || !isset($source[$this->value])) {
|
||||
if ($this->config()->default_to_locale && $this->locale()) {
|
||||
$locale = new Zend_Locale();
|
||||
$locale->setLocale($this->locale());
|
||||
$this->value = $locale->getRegion();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->value || !isset($source[$this->value])) {
|
||||
$this->value = $this->config()->default_country;
|
||||
if (!$this->value || !isset($source[$this->value])) {
|
||||
$this->value = $this->config()->default_country;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::Field();
|
||||
|
Loading…
Reference in New Issue
Block a user