From d2f7a630d880967abb9d79acea705a45171fb6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CByWater?= <“staff@bywatersolutions.com”> Date: Thu, 16 Jan 2014 15:00:40 -0500 Subject: [PATCH] Bug 11572 - Keyword searches no longer detect isbn from "Search the catalog" In Koha 3.8, if a standard catalog search was performed and the user clicked the z39.50 search button, the search string would automatically be placed in the isbn field for the z39.50 search form. Changes to the code have since broken this functionality. Test Plan: 1) From mainpage.pl, use "Search the catalog" to search for the string "9781570672835" 2) Click the Z39.50 Search button 3) Note the string is placed in the title field 4) Apply this patch 5) Repeat steps 1-2 6) Note the string is placed in the isbn field --- C4/Search.pm | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 18a0f5f..a7aa0f7 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2276,11 +2276,18 @@ $template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) ) sub z3950_search_args { my $bibrec = shift; - my $isbn = Business::ISBN->new($bibrec); + + my $isbn_string = ref( $bibrec ) ? $bibrec->{title} : $bibrec; + my $isbn = Business::ISBN->new( $isbn_string ); if (defined $isbn && $isbn->is_valid) { - $bibrec = { isbn => $bibrec } if !ref $bibrec; + if ( ref($bibrec) ) { + $bibrec->{isbn} = $isbn_string; + $bibrec->{title} = undef; + } else { + $bibrec = { isbn => $isbn_string }; + } } else { $bibrec = { title => $bibrec } if !ref $bibrec; -- 1.7.2.5