[open-ils-commits] r12720 - in branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS: Application/Search WWW (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 29 20:19:38 EDT 2009
Author: miker
Date: 2009-03-29 20:19:37 -0400 (Sun, 29 Mar 2009)
New Revision: 12720
Modified:
branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
pass the default search class correctly, instead of rewriting the query (possibly causing user confusion); require a valid class be passed to the middle layer code
Modified: branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2009-03-30 00:19:01 UTC (rev 12719)
+++ branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2009-03-30 00:19:37 UTC (rev 12720)
@@ -522,6 +522,8 @@
# This is the front part of the string before any special tokens were parsed.
# Add this data to the default search class
my $type = $arghash->{default_class} || 'keyword';
+ $type = ($type eq '-') ? 'keyword' : $type;
+ $type = ($type !~ /^(title|author|keyword|subject|series)$/o) ? 'keyword' : $type;
$search->{$type} = {} unless $search->{$type};
$search->{$type}->{term} =
($search->{$type}->{term}) ? $search->{$type}->{term} . " $query" : $query;
Modified: branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2009-03-30 00:19:01 UTC (rev 12719)
+++ branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2009-03-30 00:19:37 UTC (rev 12720)
@@ -970,9 +970,6 @@
$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');
@@ -1033,6 +1030,7 @@
limit => $limit,
sort => $sort,
sort_dir => $sortdir,
+ default_class => $class,
($lang ? ( 'language' => $lang ) : ()),
} => $terms => 1
)->gather(1);
More information about the open-ils-commits
mailing list