--- loncom/interface/domainprefs.pm 2015/05/22 14:12:08 1.160.6.64 +++ loncom/interface/domainprefs.pm 2015/06/15 20:18:35 1.160.6.65 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.160.6.64 2015/05/22 14:12:08 raeburn Exp $ +# $Id: domainprefs.pm,v 1.160.6.65 2015/06/15 20:18:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7395,10 +7395,14 @@ sub modify_quotas { if (@{$confhash{'validation'}{$item}} > 0) { @{$confhash{'validation'}{$item}} = sort(@{$confhash{'validation'}{$item}}); } - if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { - if (ref($domconfig{'requestcourses'}{'validation'}{$item}) eq 'ARRAY') { - @changed = &Apache::loncommon::compare_arrays($confhash{'validation'}{$item}, - $domconfig{'requestcourses'}{'validation'}{$item}); + if (ref($domconfig{'requestcourses'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'validation'}{$item}) eq 'ARRAY') { + @changed = &Apache::loncommon::compare_arrays($confhash{'validation'}{$item}, + $domconfig{'requestcourses'}{'validation'}{$item}); + } else { + @changed = @{$confhash{'validation'}{$item}}; + } } else { @changed = @{$confhash{'validation'}{$item}}; } @@ -7419,9 +7423,15 @@ sub modify_quotas { $env{'form.requestcourses_validation_'.$item} =~ s/[\n\r\f]+/\s/gs; } } - if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { - if ($domconfig{'requestcourses'}{'validation'}{$item} ne $confhash{'validation'}{$item}) { - $changes{'validation'}{$item} = $confhash{'validation'}{$item}; + if (ref($domconfig{'requestcourses'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { + if ($domconfig{'requestcourses'}{'validation'}{$item} ne $confhash{'validation'}{$item}) { + $changes{'validation'}{$item} = $confhash{'validation'}{$item}; + } + } else { + if ($confhash{'validation'}{$item} ne '') { + $changes{'validation'}{$item} = $confhash{'validation'}{$item}; + } } } else { if ($confhash{'validation'}{$item} ne '') { @@ -7439,14 +7449,18 @@ sub modify_quotas { } } if (ref($confhash{'validation'}) eq 'HASH') { - if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { - if ($domconfig{'requestcourses'}{'validation'}{'dc'}) { - unless ($confhash{'validation'}{'dc'} eq $domconfig{'requestcourses'}{'validation'}{'dc'}) { - if ($confhash{'validation'}{'dc'} eq '') { - $changes{'validation'}{'dc'} = &mt('None'); - } else { - $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'}; + if (ref($domconfig{'requestcourses'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { + if ($domconfig{'requestcourses'}{'validation'}{'dc'}) { + unless ($confhash{'validation'}{'dc'} eq $domconfig{'requestcourses'}{'validation'}{'dc'}) { + if ($confhash{'validation'}{'dc'} eq '') { + $changes{'validation'}{'dc'} = &mt('None'); + } else { + $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'}; + } } + } elsif ($confhash{'validation'}{'dc'} ne '') { + $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'}; } } elsif ($confhash{'validation'}{'dc'} ne '') { $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'}; @@ -7454,9 +7468,13 @@ sub modify_quotas { } elsif ($confhash{'validation'}{'dc'} ne '') { $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'}; } - } elsif (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { - if ($domconfig{'requestcourses'}{'validation'}{'dc'}) { - $changes{'validation'}{'dc'} = &mt('None'); + } else { + if (ref($domconfig{'requestcourses'}) eq 'HASH') { + if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') { + if ($domconfig{'requestcourses'}{'validation'}{'dc'}) { + $changes{'validation'}{'dc'} = &mt('None'); + } + } } } }