BUGFIX: fixed default_country_value so that it will actually call the default country if IP lookup doesnt work

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64275 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2008-10-15 03:26:24 +00:00
parent 68aaa32e86
commit 28bfea28b8

View File

@ -20,7 +20,9 @@ class CountryDropdownField extends DropdownField {
}
function Field() {
if($this->defaultToVisitorCountry && !$this->value || !isset($this->source[$this->value])) $this->value = Geoip::visitor_country();
if($this->defaultToVisitorCountry && !$this->value || !isset($this->source[$this->value])) {
$this->value = ($vc = Geoip::visitor_country()) ? $vc : Geoip::$default_country_code;
}
return parent::Field();
}
}