Bugzilla – Attachment 79359 Details for
Bug 21404
Remove unused variables in C4::Breeding->_auth_build_query
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21404: Refactor _build_query subroutines
Bug-21404-Refactor-buildquery-subroutines.patch (text/plain), 1.95 KB, created by
Josef Moravec
on 2018-09-25 07:07:19 UTC
(
hide
)
Description:
Bug 21404: Refactor _build_query subroutines
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-09-25 07:07:19 UTC
Size:
1.95 KB
patch
obsolete
>From e07834af20166268fd96b87825df342a21fcf99c Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 25 Sep 2018 07:04:03 +0000 >Subject: [PATCH] Bug 21404: Refactor _build_query subroutines > >Test plan: >1) Apply the patch >2) prove t/db_dependent/Breeding.t >3) Try to search using Z39.50, both, authority and biblio should still >work >--- > C4/Breeding.pm | 30 +++++++++++------------------- > 1 file changed, 11 insertions(+), 19 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index db8a3a4..fc539d0 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -147,7 +147,7 @@ sub Z3950Search { > my $s = 0; > my $imported=0; > >- my ( $zquery, $squery ) = _build_query( $pars ); >+ my ( $zquery, $squery ) = _bib_build_query( $pars ); > > my $schema = Koha::Database->new()->schema(); > my $rs = $schema->resultset('Z3950server')->search( >@@ -244,26 +244,11 @@ sub _auth_build_query { > controlnumber => '@attr 1=12 "#term" ', > }; > >- my $zquery=''; >- my $squery=''; >- my $nterms=0; >- foreach my $k ( sort keys %$pars ) { >- #note that the sort keys forces an identical result under Perl 5.18 >- #one of the unit tests is based on that assumption >- if( ( my $val=$pars->{$k} ) && $qry_build->{$k} ) { >- $qry_build->{$k} =~ s/#term/$val/g; >- $zquery .= $qry_build->{$k}; >- $squery .= "[$k]=\"$val\" and "; >- $nterms++; >- } >- } >- $zquery = "\@and " . $zquery for 2..$nterms; >- $squery =~ s/ and $//; >- return ( $zquery, $squery ); >- >+ return _build_query( $pars, $qry_build ); > } > >-sub _build_query { >+sub _bib_build_query { >+ > my ( $pars ) = @_; > > my $qry_build = { >@@ -280,6 +265,13 @@ sub _build_query { > stdid => '@attr 1=1007 "#term" ', > }; > >+ return _build_query( $pars, $qry_build ); >+} >+ >+sub _build_query { >+ >+ my ( $pars, $qry_build ) = @_; >+ > my $zquery=''; > my $squery=''; > my $nterms=0; >-- >2.1.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 21404
:
79357
|
79358
|
79359
|
79443
|
79444
|
79445
|
79492
|
79493
|
79494