Bugzilla – Attachment 6860 Details for
Bug 7148
Add some error handling to Acquisitions' Z39.50 search to match Cataloging's
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for Bug 7148 - Add some error handling to Acquisitions' Z39.50 search to match Cataloging's
Fix-for-Bug-7148---Add-some-error-handling-to-Acqu.patch (text/plain), 5.68 KB, created by
Chris Cormack
on 2011-12-19 07:27:10 UTC
(
hide
)
Description:
Fix for Bug 7148 - Add some error handling to Acquisitions' Z39.50 search to match Cataloging's
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-12-19 07:27:10 UTC
Size:
5.68 KB
patch
obsolete
>From 70967cedfae606a2e2c266924329b019bc9a0cfc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 3 Nov 2011 10:22:11 -0400 >Subject: [PATCH] Fix for Bug 7148 - Add some error handling to Acquisitions' > Z39.50 search to match Cataloging's > >- Copying over error handling for timeout(10007) and refused(10000) >- Copying over error handling for submission with no targets chosen >- Correcting "cancel" link in the template which was not modified > when it was copied from cataloging's popup window template. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > acqui/z3950_search.pl | 33 +++++++++++--------- > .../prog/en/modules/acqui/z3950_search.tt | 9 +++++- > 2 files changed, 26 insertions(+), 16 deletions(-) > >diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl >index 47dbe52..80503e0 100755 >--- a/acqui/z3950_search.pl >+++ b/acqui/z3950_search.pl >@@ -134,8 +134,17 @@ if ( $op ne "do_search" ) { > } > else { > my @id = $input->param('id'); >+ >+ if ( not defined @id ) { >+ # empty server list -> report and exit >+ $template->param( emptyserverlist => 1 ); >+ output_html_with_http_headers $input, $cookie, $template->output; >+ exit; >+ } >+ > my @oConnection; > my @oResult; >+ my @errconn; > my $s = 0; > my $query; > my $nterms; >@@ -164,7 +173,7 @@ else { > $query .= " \@attr 1=21 \"$subject\" "; > $nterms++; > } >- if ($lccn) { >+ if ($lccn) { > $query .= " \@attr 1=9 $lccn "; > $nterms++; > } >@@ -186,7 +195,6 @@ warn "query ".$query if $DEBUG; > $sth->execute($servid); > while ( $server = $sth->fetchrow_hashref ) { > warn "serverinfo ".join(':',%$server) if $DEBUG; >- my $noconnection = 0; > my $option1 = new ZOOM::Options(); > $option1->option( 'async' => 1 ); > $option1->option( 'elementSetName', 'F' ); >@@ -237,9 +245,10 @@ sub displayresults { > my ( $error, $errmsg, $addinfo, $diagset ) = > $oConnection[$k]->error_x(); > if ($error) { >- warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n" >- if $DEBUG; >- >+ if ($error =~ m/^(10000|10007)$/ ) { >+ push(@errconn, {'server' => $serverhost[$k]}); >+ } >+ $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n"; > } > else { > my $numresults = $oResult[$k]->size(); >@@ -280,13 +289,6 @@ sub displayresults { > ) > = ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' ); > my %row_data; >- if ( $i % 2 ) { >- $toggle = 1; >- } >- else { >- $toggle = 0; >- } >- $row_data{toggle} = $toggle; > $row_data{server} = $servername[$k]; > $row_data{isbn} = $oldbiblio->{isbn}; > $row_data{lccn} = $oldbiblio->{lccn}; >@@ -295,9 +297,9 @@ sub displayresults { > $row_data{breedingid} = $breedingid; > $row_data{biblionumber} = $biblionumber; > push( @breeding_loop, \%row_data ); >- >+ > } else { >- push(@breeding_loop,{'toggle'=>($i % 2)?1:0,'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); >+ push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); > } # $rec > } # upto 5 results > } #$numresults >@@ -308,10 +310,11 @@ sub displayresults { > breeding_loop => \@breeding_loop, > server => $servername[$k], > numberpending => $numberpending, >+ errconn => \@errconn > ); > output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; > >- # print $template->output if $firstresult !=1; >+ # print $template->output if $firstresult !=1; > $firstresult++; > } > displayresults(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index 66dbc6e..1f2ad60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -120,7 +120,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > > </p> > [% END %] >- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset> >+ <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset> > </div> > </form> > >@@ -155,6 +155,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %]</tbody> > </table> > [% ELSE %] >+ [% IF ( emptyserverlist ) %] >+ You didn't select any Z39.50 target. >+ [% ELSE %] >+ [% FOREACH errcon IN errconn %] >+ Connection failed to [% errcon.server %] >+ [% END %] >+ [% END %] > <p>Nothing found. <a href="javascript: history.back()">Try another search</a>.</p> > [% END %] > >-- >1.7.5.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7148
:
6165
| 6860