Bugzilla – Attachment 52870 Details for
Bug 16746
Can not find duplicated authorities cataloguing a new one
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16746: Proposed start of counter-patch
Bug-16746-Proposed-start-of-counter-patch.patch (text/plain), 2.50 KB, created by
Mark Tompsett
on 2016-06-25 04:27:40 UTC
(
hide
)
Description:
Bug 16746: Proposed start of counter-patch
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-06-25 04:27:40 UTC
Size:
2.50 KB
patch
obsolete
>From 44f7c1fa594f68d1cadacc9d47c1e64819fdbb47 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 24 Jun 2016 11:29:02 -0400 >Subject: [PATCH] Bug 16746: Proposed start of counter-patch > >This is the beginning of a counter patch. >Feel free to apply it and test it, Juan Romay Sieira. >However, please expand the test plan to be more >detailed: > >-- type X into field Y >-- click button Z >-- click downdrop W >-- select item V >-- enter 'text' into text box labelled A > >"Add a new authority that exists in your > authority server, Koha will now find none." >is not detailed enough for a person unfamiliar with the >interface. > >Feel free to apply 16809 first. :) >--- > Koha/SearchEngine/Zebra/Search.pm | 45 +++++++++++++++++++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 2 deletions(-) > >diff --git a/Koha/SearchEngine/Zebra/Search.pm b/Koha/SearchEngine/Zebra/Search.pm >index cb69e22..2f47822 100644 >--- a/Koha/SearchEngine/Zebra/Search.pm >+++ b/Koha/SearchEngine/Zebra/Search.pm >@@ -21,13 +21,48 @@ use Modern::Perl; > > use base qw(Class::Accessor); > >+# Added index accessor, because base isn't Koha::SearchEngine >+# Because of nasty nested loopy dependencies that would >+# break things if it was changed right now. >+__PACKAGE__->mk_ro_accessors(qw( index )); >+ > use C4::Search; # :( > use C4::AuthoritiesMarc; >+use Carp; > > =head1 NAME > > Koha::SearchEngine::Zebra::Search - Search implementation for Zebra > >+=head1 ACCESSORS >+ >+=over 4 >+ >+=item index >+ >+The name of the index to use, generally 'biblios' or 'authorities'. >+It is provided as a parameter when this is instantiated. >+ >+ my $index = 'authorities'; # could be 'biblios' >+ my $searcher = >+ Koha::SearchEngine::Zebra::Search->new( { index => $index } ); >+ >+=back >+ >+=cut >+ >+sub new { >+ my @parameters = @_; >+ my $class = shift @parameters; >+ my $self = $class->SUPER::new(@parameters); >+ >+ # Check for a valid index >+ if ( !defined $self->index ) { >+ croak('No index name provided'); >+ } >+ return $self; >+} >+ > =head1 METHODS > > =head2 search >@@ -72,8 +107,14 @@ This passes straight through to C4::Search::SimpleSearch. > > > sub simple_search_compat { >- shift; >- return C4::Search::SimpleSearch(@_); >+ my @parameters = @_; >+ my $self = shift @parameters; >+ >+ # default is ['biblioserver'], so just fix authorities. >+ if ( $self->index eq 'authorities' ) { >+ push @parameters, ['authorityserver']; >+ } >+ return C4::Search::SimpleSearch(@parameters); > } > > =head2 search_auth_compat >-- >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 16746
:
52440
|
52869
| 52870