Index: lib/weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.1124
diff -u -F ^f -r1.1124 weblib.php
--- lib/weblib.php	7 Aug 2008 22:38:46 -0000	1.1124
+++ lib/weblib.php	14 Aug 2008 02:26:19 -0000
@@ -1101,7 +1101,16 @@ function popup_form($common, $options, $
     }
 
     if ($nothing != '') {
-        $output .= "   <option value=\"javascript:void(0)\">$nothing</option>\n";
+        $selectlabeloption = '';
+        if ($selected=='') {
+            $selectlabeloption = ' selected="selected"';
+        }
+        foreach ($options as $value => $label) {  //if one of the options is the empty value, don't make this the default
+            if ($value == '') {
+                $selected = '';
+            }
+        }
+        $output .= "   <option value=\"javascript:void(0)\"$selectlabeloption>$nothing</option>\n";
     }
 
     $inoptgroup = false;
