Bugzilla – Attachment 98423 Details for
Bug 24586
Double quote escape doesn't work properly in C4::AuthoritiesMarc::SearchAuthorities with QueryParser enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24586: Gracefully fail authority lookup if PQF query invalid
Bug-24586-Gracefully-fail-authority-lookup-if-PQF-.patch (text/plain), 1.60 KB, created by
David Cook
on 2020-02-05 04:55:42 UTC
(
hide
)
Description:
Bug 24586: Gracefully fail authority lookup if PQF query invalid
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-02-05 04:55:42 UTC
Size:
1.60 KB
patch
obsolete
>From a7732c6463c7e3949759e34087b6035c44c1480c Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 5 Feb 2020 15:51:24 +1100 >Subject: [PATCH] Bug 24586: Gracefully fail authority lookup if PQF query > invalid > >If Koha's query building has produced an invalid PQF query, don't >throw a fatal error. Instead, trap the error, warn, and then skip >the authority lookup for that field. > >Test Plan: > >I don't really have a good test plan at the moment. Enable >AutoCreateAuthorities and BiblioAddsAuthorities maybe, and then >try to do a search for 830$a with a value of the following: > >Bad "query" value >--- > C4/AuthoritiesMarc.pm | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index c5b2131408..6b04066e89 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -248,8 +248,17 @@ sub SearchAuthorities { > my @oAuth; > my $i; > $oAuth[0]=C4::Context->Zconn("authorityserver" , 1); >- my $Anewq= new ZOOM::Query::PQF($query,$oAuth[0]); >+ my $Anewq; >+ eval { >+ $Anewq= new ZOOM::Query::PQF($query,$oAuth[0]); >+ }; >+ if ($@){ >+ warn "Bad PQF query: $@"; >+ } > my $oAResult; >+ if ( ! $Anewq ){ >+ goto NOLUCK; >+ } > $oAResult= $oAuth[0]->search($Anewq) ; > while (($i = ZOOM::event(\@oAuth)) != 0) { > my $ev = $oAuth[$i-1]->last_event(); >@@ -336,7 +345,7 @@ sub SearchAuthorities { > > }## if nbresult > NOLUCK: >- $oAResult->destroy(); >+ $oAResult->destroy() if $oAResult; > # $oAuth[0]->destroy(); > > return (\@finalresult, $nbresults); >-- >2.16.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 24586
: 98423 |
98721