[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Tue Jul 15 17:52:17 EDT 2014


raeburn		Tue Jul 15 21:52:17 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport 1.248, 1.249
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.50 loncom/interface/domainprefs.pm:1.160.6.51
--- loncom/interface/domainprefs.pm:1.160.6.50	Sat May 31 04:32:12 2014
+++ loncom/interface/domainprefs.pm	Tue Jul 15 21:52:16 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.50 2014/05/31 04:32:12 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.51 2014/07/15 21:52:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2065,9 +2065,11 @@
     my $rownum = 0; 
     my ($output,%current);
     my @crstypes = ('official','unofficial','community','textbook');
-    if (ref($settings->{'uniquecode'}) eq 'HASH') {
-        foreach my $type (@crstypes) {
-            $current{$type} = $settings->{'uniquecode'}{$type};
+    if (ref($settings) eq 'HASH') {
+        if (ref($settings->{'uniquecode'}) eq 'HASH') {
+            foreach my $type (@crstypes) {
+                $current{$type} = $settings->{'uniquecode'}{$type};
+            }
         }
     }
     $output .= '<tr>'.
@@ -3101,9 +3103,11 @@
     }
     if ($caller eq 'requestcourses') {
         my %currhash;
-        if (ref($settings->{'validation'}) eq 'HASH') {
-            if ($settings->{'validation'}{'dc'} ne '') {
-                $currhash{$settings->{'validation'}{'dc'}} = 1;
+        if (ref($settings) eq 'HASH') {
+            if (ref($settings->{'validation'}) eq 'HASH') {
+                if ($settings->{'validation'}{'dc'} ne '') {
+                    $currhash{$settings->{'validation'}{'dc'}} = 1;
+                }
             }
         }
         my $numinrow = 2;
@@ -4142,8 +4146,10 @@
                 $datatable .= '<tr>';
             }
             my $currval;
-            if (ref($createsettings->{'shibenv'}) eq 'HASH') {
-                $currval = $createsettings->{'shibenv'}{$fields[$i]};
+            if (ref($createsettings) eq 'HASH') {
+                if (ref($createsettings->{'shibenv'}) eq 'HASH') {
+                    $currval = $createsettings->{'shibenv'}{$fields[$i]};
+                }
             }
             $datatable .= '<td class="LC_left_item">'.
                           '<span class="LC_nobreak">'.
@@ -5147,14 +5153,14 @@
 
 sub defaults_javascript {
     my ($settings) = @_;
-    my ($output,$jstext); 
+    return unless (ref($settings) eq 'HASH');
     if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
         my $maxnum = scalar(@{$settings->{'inststatusorder'}});
         if ($maxnum eq '') {
             $maxnum = 0;
         }
         $maxnum ++;
-        $jstext = '    var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';  
+        my $jstext = '    var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';  
         return <<"ENDSCRIPT";
 <script type="text/javascript">
 // <![CDATA[




More information about the LON-CAPA-cvs mailing list