[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 21 Mar 2005 21:01:16 -0000


matthew		Mon Mar 21 16:01:16 2005 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
  Log:
  Fix bug where unspecified domain restriction in basic search would cause invalid SQL
  to be sent out.
  
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.239 loncom/interface/lonsearchcat.pm:1.240
--- loncom/interface/lonsearchcat.pm:1.239	Wed Mar 16 17:46:24 2005
+++ loncom/interface/lonsearchcat.pm	Mon Mar 21 16:01:15 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.239 2005/03/16 22:46:24 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.240 2005/03/21 21:01:15 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1555,7 +1555,7 @@
     # $ENV{'form.domains'} can be either a scalar or an array reference.
     # We need an array.
     if (! exists($ENV{'form.domains'}) || $ENV{'form.domains'} eq '') {
-        return (undef,'');
+        return (undef,'',undef);
     }
     my @allowed_domains;
     if (ref($ENV{'form.domains'})) {
@@ -1645,7 +1645,9 @@
         return;
     }
     push(@Queries,$SQLQuery);
-    push(@Queries,$domain_sql_restriction);
+    if (defined($domain_sql_restriction) && $domain_sql_restriction ne '') {
+        push(@Queries,$domain_sql_restriction);
+    }
     #foreach my $q (@Queries) {
     #    &Apache::lonnet::logthis('    '.$q);
     #}
@@ -2444,7 +2446,7 @@
 <table>
 <tr><th>Status</th><th>Total Matches</th><th>Time Remaining</th><th></th></tr>
 <tr>
-<td><input type="text" name="status"  value="" size="30" /></td>
+<td><input type="text" name="status"  value="" size="50" /></td>
 <td><input type="text" name="count"   value="" size="10" /></td>
 <td><input type="text" name="seconds" value="" size="8" /></td>
 <td>$revise</td>