--- loncom/interface/lonsearchcat.pm 2004/04/19 16:53:27 1.209 +++ loncom/interface/lonsearchcat.pm 2004/04/19 17:40:00 1.210 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.209 2004/04/19 16:53:27 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.210 2004/04/19 17:40:00 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1918,11 +1918,13 @@ END END $r->rflush(); my $time_remaining = $max_time - (time - $starttime) ; + $time_remaining = 0 if ($time_remaining <0); my $last_time = $time_remaining; &update_seconds($r,$time_remaining); &update_status($r,'contacting '.$Servers_to_contact[0]); while (($time_remaining > 0) && ((@Servers_to_contact) || keys(%Server_status))) { + &update_seconds($r,$time_remaining); # Send out a search request if it needs to be done. if (@Servers_to_contact) { # Contact one server @@ -1948,6 +1950,12 @@ END # have results from yet, looking for results. while (my ($server,$status) = each(%Server_status)) { last if ($connection->aborted()); + $time_remaining = $max_time - (time - $starttime) ; + $time_remaining = 0 if ($time_remaining < 0); + if ($last_time - $time_remaining > 0) { + $last_time = $time_remaining; + &update_seconds($r,$time_remaining); + } if ($status eq 'con_lost') { delete ($Server_status{$server}); next; @@ -1990,6 +1998,7 @@ END # $r->print(&Apache::lonmysql::get_debug()); $hitcountsum ++; $time_remaining = $max_time - (time - $starttime) ; + $time_remaining = 0 if ($time_remaining < 0); if ($last_time - $time_remaining > 0) { &update_seconds($r,$time_remaining); $last_time = $time_remaining; @@ -2185,6 +2194,9 @@ sub display_results { } my %Fields = %{&parse_row(@$row)}; my $output="

\n"; + if (! defined($Fields{'title'}) || $Fields{'title'} eq '') { + $Fields{'title'} = 'Untitled'; + } my $prefix=&catalogmode_output($Fields{'title'},$Fields{'url'}, $Fields{'id'},$checkbox_num++); # Render the result into html