Merge branch '3.5' into 3.6

This commit is contained in:
Daniel Hensby 2017-06-28 11:10:43 +01:00
commit d94182702c
No known key found for this signature in database
GPG Key ID: E38EC566FE29EB66

View File

@ -58,16 +58,18 @@ class CountryDropdownField extends DropdownField {
public function Field($properties = array()) { public function Field($properties = array()) {
$source = $this->getSource(); $source = $this->getSource();
if (!$this->value || !isset($source[$this->value])) { if(!$this->getHasEmptyDefault()){
if ($this->config()->default_to_locale && $this->locale()) { if (!$this->value || !isset($source[$this->value])) {
$locale = new Zend_Locale(); if ($this->config()->default_to_locale && $this->locale()) {
$locale->setLocale($this->locale()); $locale = new Zend_Locale();
$this->value = $locale->getRegion(); $locale->setLocale($this->locale());
$this->value = $locale->getRegion();
}
} }
}
if (!$this->value || !isset($source[$this->value])) { if (!$this->value || !isset($source[$this->value])) {
$this->value = $this->config()->default_country; $this->value = $this->config()->default_country;
}
} }
return parent::Field(); return parent::Field();