Ticket #2510 (closed patch: fixed)
CountryDropdownField patch
| Reported by: | mandrew | Owned by: | sminnee |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Sapphire Framework | Version: | 2.2.2-rc3 |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description
This is how we should be setting the country dropdown field. Please add this to the core so we can set the default country manually when geoip gets confused or wrong.
class CountryDropdownField? extends DropdownField? {
function construct($name, $title, $source = null, $value = "") {
if(!is_array($source)) {
$source = Geoip::getCountryDropDown();
}
parent::construct($name, $title, Geoip::getCountryDropDown(), $value);
}
function Field() {
if(!$this->value
!$this->source[$this->value]) $this->value = Geoip::visitor_country(); return parent::Field(); }
}
Change History
Note: See TracTickets for help on using tickets.Download in other formats:
