--- loncom/interface/lonclonecourse.pm 2008/01/22 22:37:18 1.6 +++ loncom/interface/lonclonecourse.pm 2014/12/11 01:14:40 1.10 @@ -1,7 +1,7 @@ # The LearningOnline Network # routines for clone a course # -# $Id: lonclonecourse.pm,v 1.6 2008/01/22 22:37:18 www Exp $ +# $Id: lonclonecourse.pm,v 1.10 2014/12/11 01:14:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,21 +47,24 @@ sub innercrsdirlist { unless ($which) { $which=''; } else { $which.='/'; } unless ($path) { $path=''; } else { $path.='/'; } my %crsdata=&Apache::lonnet::coursedescription($courseid); - my @listing=&Apache::lonnet::dirlist - ($which,$crsdata{'domain'},$crsdata{'num'}, - &propath($crsdata{'domain'},$crsdata{'num'})); - foreach (@listing) { - unless ($_=~/^\./) { - my @unpackline = split (/\&/,$_); - if ($unpackline[3]&$dirptr) { + my $getpropath = 1; + my ($dirlistref,$listerror) = + &Apache::lonnet::dirlist($which,$crsdata{'domain'}, + $crsdata{'num'},$getpropath); + if (ref($dirlistref) eq 'ARRAY') { + foreach (@{$dirlistref}) { + unless ($_=~/^\./) { + my @unpackline = split (/\&/,$_); + if ($unpackline[3]&$dirptr) { # is a directory, recurse - &innercrsdirlist($courseid,$which.$unpackline[0], - $path.$unpackline[0]); - } else { + &innercrsdirlist($courseid,$which.$unpackline[0], + $path.$unpackline[0]); + } else { # is a file, put into output - push (@output,$path.$unpackline[0]); + push (@output,$path.$unpackline[0]); + } } - } + } } return @output; } @@ -163,7 +166,7 @@ sub copyresourcedb { $startdate = $start{'default_enrollment_start_date'}; } # ugly retro fix for broken version of types - foreach my $key (keys %data) { + foreach my $key (keys(%data)) { if ($key=~/\wtype$/) { my $newkey=$key; $newkey=~s/type$/\.type/; @@ -174,7 +177,7 @@ sub copyresourcedb { # adjust symbs my $pattern='uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'; my $new= 'uploaded/'. $newcrsdata{'domain'}.'/'. $newcrsdata{'num'}.'/'; - foreach my $key (keys %data) { + foreach my $key (keys(%data)) { if ($key=~/\Q$pattern\E/) { my $newkey=$key; $newkey=~s/\Q$pattern\E/$new/; @@ -183,7 +186,7 @@ sub copyresourcedb { } } # transfer hash - foreach my $key (keys %data) { + foreach my $key (keys(%data)) { my $thiskey=$key; $thiskey=~s/^$origcrsid/$newcrsid/; $newdata{$thiskey}=$data{$key}; @@ -225,7 +228,7 @@ sub copydbfiles { foreach (&crsdirlist($origcrsid)) { if ($_=~/\.db$/) { unless - ($_=~/^(nohist\_|discussiontimes|classlist|versionupdate|resourcedata|\Q$origcrs_discussion\E|slots|slot_reservations|gradingqueue|reviewqueue|CODEs|groupmembership)/) { + ($_=~/^(nohist\_|disclikes|discussiontimes|classlist|versionupdate|resourcedata|\Q$origcrs_discussion\E|slots|slot_reservations|gradingqueue|reviewqueue|CODEs|groupmembership)/) { ©db($origcrsid,$newcrsid,$_); } } 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.