[Koha-cvs] koha/C4 Search.pm [dev_week]

Joshua Ferraro jmf at kados.org
Thu Dec 14 21:26:06 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/12/14 20:26:06

Modified files:
	C4             : Search.pm 

Log message:
	Fix for bug #1254: searching existing records in acqui.simple/addbook.pl produces 500 error

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.99.2.11.2.37&r2=1.99.2.11.2.38

Patches:
Index: Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.11.2.37
retrieving revision 1.99.2.11.2.38
diff -u -b -r1.99.2.11.2.37 -r1.99.2.11.2.38
--- Search.pm	11 Dec 2006 19:07:32 -0000	1.99.2.11.2.37
+++ Search.pm	14 Dec 2006 20:26:06 -0000	1.99.2.11.2.38
@@ -40,7 +40,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.99.2.11.2.37 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.99.2.11.2.38 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -64,6 +64,7 @@
 @EXPORT = qw(
 
 &CatSearch 
+&catalogsearch
 
 &BornameSearch &ItemInfo &KeywordSearch 
 
@@ -2699,6 +2700,13 @@
         my $counter = 0;
         my @link_loop;
         for my $series_subfield (@subfields ) {
+			my $volume_number;
+			undef $volume_number;
+			# see if this is an instance of a volume
+			if ($series_subfield->[0] eq 'v') {
+				$volume_number=1;
+			}
+
             my $code = $series_subfield->[0];
             my $value = $series_subfield->[1];
             my $linkvalue = $value;
@@ -2706,7 +2714,12 @@
             my $operator = " and " unless $counter==0;
             push @link_loop, {link => $linkvalue, operator => $operator };
             my $separator = C4::Context->preference("authoritysep") unless $counter==0;
-            push @subfields_loop, {code => $code, value => $value, link_loop => \@link_loop, separator => $separator};
+			if ($volume_number) {
+			push @subfields_loop, {volumenum => $value};
+			}
+			else {
+            push @subfields_loop, {code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number};
+			}
             $counter++;
         }
         push @marcseries, { MARCSERIES_SUBFIELDS_LOOP => \@subfields_loop };
@@ -3385,7 +3398,7 @@
 	$human_search_desc =~ s/  / /g;
 	$human_search_desc =~s/^ //g;	
 	my $koha_query = $query;
-	warn "QUERY:".$koha_query;
+	#warn "QUERY:".$koha_query;
 	#warn "SEARCHDESC:".$human_search_desc;
 	#warn "FEDERATED QUERY:".$federated_query;
     return (undef,$human_search_desc,$koha_query,$federated_query);
@@ -3395,7 +3408,7 @@
 # building the HTML output for the template
 sub searchResults {
     my ($searchdesc,$hits,$results_per_page,$offset, at marcresults)=@_;
-	warn "HITS:$hits\n";
+	#warn "HITS:$hits\n";
     my $dbh= C4::Context->dbh;
     my $toggle;
     my $even=1;





More information about the Koha-cvs mailing list