[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
raeburn at source.lon-capa.org
Mon Jun 15 16:11:57 EDT 2015
raeburn Mon Jun 15 20:11:57 2015 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Need to check if the requestcourses domain config does point at a hash,
because if has yet to be configured, then it will not (and there will be
an ISE.
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.265 loncom/interface/domainprefs.pm:1.266
--- loncom/interface/domainprefs.pm:1.265 Tue Jun 9 21:22:55 2015
+++ loncom/interface/domainprefs.pm Mon Jun 15 20:11:56 2015
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.265 2015/06/09 21:22:55 damieng Exp $
+# $Id: domainprefs.pm,v 1.266 2015/06/15 20:11:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7417,10 +7417,14 @@
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}};
}
@@ -7441,9 +7445,15 @@
$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 '') {
@@ -7461,24 +7471,32 @@
}
}
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'};
}
} 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');
+ }
+ }
}
}
}
More information about the LON-CAPA-cvs
mailing list