]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-6696 Default country doesn't display on dropdown menu
authorskodak <skodak>
Sat, 30 Sep 2006 19:46:10 +0000 (19:46 +0000)
committerskodak <skodak>
Sat, 30 Sep 2006 19:46:10 +0000 (19:46 +0000)
lib/adminlib.php

index 92a7a85a25d85f6e4eed28fe82935222966db50c..9163be76dffb48650b7592225fa07512c13157f4 100644 (file)
@@ -1415,7 +1415,8 @@ class admin_setting_configselect extends admin_setting {
         }
         $return = '<select class="form-select" id="id_s_'.$this->name.'" name="s_' . $this->name .'">';
         foreach ($this->choices as $key => $value) {
-            $return .= '<option value="'.$key.'"'.($key==$current ? ' selected="selected"' : '').'>'.$value.'</option>';
+            // the string cast is needed because key may be integer - 0 is equal to most strings!
+            $return .= '<option value="'.$key.'"'.((string)$key==$current ? ' selected="selected"' : '').'>'.$value.'</option>';
         }
         $return .= '</select>';