[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sun, 23 Dec 2007 16:55:28 -0000


raeburn		Sun Dec 23 11:55:28 2007 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  Dynamic population of currsec dropdown box was not correct when no sections currently exist in a course. 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.628 loncom/interface/loncommon.pm:1.629
--- loncom/interface/loncommon.pm:1.628	Sat Dec 22 23:11:21 2007
+++ loncom/interface/loncommon.pm	Sun Dec 23 11:55:25 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.628 2007/12/23 04:11:21 raeburn Exp $
+# $Id: loncommon.pm,v 1.629 2007/12/23 16:55:25 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -472,7 +472,10 @@
     my ($sec_element,$formname) = @_;
     my $setsections = qq|
 function setSect(sectionlist) {
-    var sectionsArray = sectionlist.split(",");
+    var sectionsArray = new Array();
+    if ((sectionlist != '') && (typeof sectionlist != "undefined")) {
+        sectionsArray = sectionlist.split(",");
+    }
     var numSections = sectionsArray.length;
     document.$formname.$sec_element.length = 0;
     if (numSections == 0) {