--- loncom/interface/domainprefs.pm 2014/05/31 04:00:02 1.247 +++ loncom/interface/domainprefs.pm 2014/07/15 20:04:03 1.248 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.247 2014/05/31 04:00:02 raeburn Exp $ +# $Id: domainprefs.pm,v 1.248 2014/07/15 20:04:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2084,9 +2084,11 @@ sub print_studentcode { 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 .= ''. @@ -3120,9 +3122,11 @@ sub print_validation_rows { } 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; @@ -4161,8 +4165,10 @@ sub print_selfcreation { $datatable .= ''; } 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 .= ''. ''. @@ -5166,7 +5172,8 @@ sub serverstatus_pages { sub defaults_javascript { my ($settings) = @_; - my ($output,$jstext); + 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 '') {