--- loncom/interface/lonsearchcat.pm 2004/12/17 21:44:19 1.235 +++ loncom/interface/lonsearchcat.pm 2005/04/01 20:01:32 1.237.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.235 2004/12/17 21:44:19 albertel Exp $ +# $Id: lonsearchcat.pm,v 1.237.2.1 2005/04/01 20:01:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -445,6 +445,7 @@ sub hidden_field { { # Scope the course search to avoid global variables # # Variables For course search +my %alreadyseen; my %hash; my $totalfound; @@ -463,6 +464,7 @@ sub course_search { my $pretty_search_string = ''.$ENV{'form.courseexp'}.''; my $search_string = $ENV{'form.courseexp'}; my @New_Words; + undef(%alreadyseen); if ($ENV{'form.crsrelated'}) { ($search_string,@New_Words) = &related_version($ENV{'form.courseexp'}); if (@New_Words) { @@ -581,6 +583,8 @@ sub course_search { sub checkonthis { my ($r,$id,$url,$level,$title,$fulltext,$symb,@allwords)=@_; + $alreadyseen{$id}=1; + if (&Apache::loncommon::connection_aborted($r)) { return; } $r->rflush(); my $result=$title.' '; @@ -622,7 +626,7 @@ sub checkonthis { my $dependencies= &Apache::lonnet::metadata($url,'dependencies'); foreach (split(/\,/,$dependencies)) { - if (($_=~/^\/res\//)) { + if (($_=~/^\/res\//) && (!$alreadyseen{$id})) { &checkonthis($r,$id,$_,$level+1,'',$fulltext,undef,@allwords); } } @@ -2465,8 +2469,8 @@ END delete ($Server_status{$server}); next; } - $status=~/^([\.\w]+)$/; - my $datafile=$r->dir_config('lonDaemons').'/tmp/'.$1; + $status=~s|/||g; + my $datafile=$r->dir_config('lonDaemons').'/tmp/'.$status; if (-e $datafile && ! -e "$datafile.end") { &update_status($r,&mt('Receiving results from [_1]',$server)); next;