Fix for #54 - make SlimPAC search respect title/keyword/author/subject/series index
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 29 Mar 2009 20:36:46 +0000 (20:36 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 29 Mar 2009 20:36:46 +0000 (20:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12713 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm

index 86f1a89..a6b17f5 100644 (file)
@@ -1008,6 +1008,9 @@ sub opensearch_feed {
        $terms .= $cgi->param('searchTerms') if $cgi->param('searchTerms');
 
        $class = $cgi->param('searchClass') if $cgi->param('searchClass');
+       if ($class && $terms !~ m/^$class:/o) {
+               $terms =~ s{^(\S*:)?\s*}{$class: }o;
+       }
        $class ||= '-';
 
        $type = $cgi->param('responseType') if $cgi->param('responseType');