--- loncom/interface/lonsearchcat.pm 2016/11/09 22:32:42 1.331.4.14 +++ loncom/interface/lonsearchcat.pm 2020/08/26 01:29:48 1.331.4.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.331.4.14 2016/11/09 22:32:42 raeburn Exp $ +# $Id: lonsearchcat.pm,v 1.331.4.16 2020/08/26 01:29:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1881,6 +1881,8 @@ sub build_date_queries { my (undef,undef,undef,$cbday,$cbmon,$cbyear) = localtime($cbefore); # Correct for year being relative to 1900 $cayear+=1900; $cbyear+=1900; + # Correct month; localtime gives month 0..11 but MySQL expects 1..12 + $camon++; $cbmon++; my $cquery= '(creationdate BETWEEN '. "'".$cayear.'-'.$camon.'-'.$caday."'". @@ -1899,6 +1901,8 @@ sub build_date_queries { my (undef,undef,undef,$mbday,$mbmon,$mbyear) = localtime($mbefore); # Correct for year being relative to 1900 $mayear+=1900; $mbyear+=1900; + # Correct month; localtime gives month 0..11 but MySQL expects 1..12 + $mamon++; $mbmon++; my $mquery= '(lastrevisiondate BETWEEN '. "'".$mayear.'-'.$mamon.'-'.$maday."'". @@ -2455,6 +2459,7 @@ END ## Prepare for the big loop. my $hitcountsum; my $oldhitcountsum; + my $displaycount; my %matches; my $server; my $status; @@ -2579,8 +2584,10 @@ END last if ($connection->aborted()); if ($oldhitcountsum < $hitcountsum) { &update_count_status($r,$hitcountsum); - if ($hitcountsum <= $env{'form.show'}) { + if (($hitcountsum <= $env{'form.show'}) || + (!$displaycount && $hitcountsum)) { reload_result_frame($r); + $displaycount = $hitcountsum; } $oldhitcountsum = $hitcountsum; }