Bugzilla – Attachment 73452 Details for
Bug 16588
Remove the Readonly dependency (again)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16588: Follow up with more missing changes
Bug-16588-Follow-up-with-more-missing-changes.patch (text/plain), 8.03 KB, created by
Mark Tompsett
on 2018-03-30 02:49:40 UTC
(
hide
)
Description:
Bug 16588: Follow up with more missing changes
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-03-30 02:49:40 UTC
Size:
8.03 KB
patch
obsolete
>From 89d873d2fb97ae0a340f4f0c69fff6ba5ea9601a Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 30 Mar 2018 02:04:12 +0000 >Subject: [PATCH] Bug 16588: Follow up with more missing changes > >Hunting for _INDEX and $Koha::SearchEngine provided >more places to tweak. > >Added 'use Koha::SearchEngine;' where the constant was referenced. >--- > C4/Matcher.pm | 4 ++-- > Koha/Authorities.pm | 6 +++--- > Koha/SearchEngine/Elasticsearch.pm | 6 ------ > about.pl | 5 +++-- > authorities/auth_finder.pl | 5 +++-- > authorities/authorities-home.pl | 1 + > catalogue/search.pl | 1 + > cataloguing/addbooks.pl | 1 + > misc/search_tools/rebuild_elastic_search.pl | 5 +++-- > opac/opac-authorities-home.pl | 1 + > 10 files changed, 18 insertions(+), 17 deletions(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 7ec931b..556818b 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -703,8 +703,8 @@ sub get_matches { > push @operator, 'exact'; > push @value, $key; > } >- my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); >- my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); >+ my $builder = Koha::SearchEngine::QueryBuilder->new({index => Koha::SearchEngine::AUTHORITIES_INDEX}); >+ my $searcher = Koha::SearchEngine::Search->new({index => Koha::SearchEngine::AUTHORITIES_INDEX}); > my $search_query = $builder->build_authorities_query_compat( > \@marclist, \@and_or, \@excluding, \@operator, > \@value, undef, 'AuthidAsc' >diff --git a/Koha/Authorities.pm b/Koha/Authorities.pm >index ca150c4..1397334 100644 >--- a/Koha/Authorities.pm >+++ b/Koha/Authorities.pm >@@ -22,8 +22,8 @@ use Modern::Perl; > use Carp; > > use Koha::Database; >- > use Koha::Authority; >+use Koha::SearchEngine; > > use base qw(Koha::Objects); > >@@ -51,7 +51,7 @@ sub get_usage_count { > my ( $class, $params ) = @_; > my $authid = $params->{authid} || return; > >- my $searcher = Koha::SearchEngine::Search->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); >+ my $searcher = Koha::SearchEngine::Search->new({ index => Koha::SearchEngine::BIBLIOS_INDEX }); > my ( $err, $result, $count ) = $searcher->simple_search_compat( 'an:' . $authid, 0, 0 ); > if( $err ) { > warn "Error: $err from search for " . $authid; >@@ -77,7 +77,7 @@ sub linked_biblionumbers { > my ( $self, $params ) = @_; > my $authid = $params->{authid} || return; > >- my $searcher = Koha::SearchEngine::Search->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); >+ my $searcher = Koha::SearchEngine::Search->new({ index => Koha::SearchEngine::BIBLIOS_INDEX }); > # if max_results is undefined, we will get all results > my ( $err, $result, $count ) = $searcher->simple_search_compat( 'an:' . $authid, $params->{offset} // 0, $params->{max_results} ); > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 1efe5a9..c7c67e2 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -38,12 +38,6 @@ use Data::Dumper; # TODO remove > __PACKAGE__->mk_ro_accessors(qw( index )); > __PACKAGE__->mk_accessors(qw( sort_fields )); > >-# Constants to refer to the standard index names >-use constant { >- BIBLIOS_INDEX => 'biblios', >- AUTHORITIES_INDEX => 'authorities', >-}; >- > =head1 NAME > > Koha::SearchEngine::Elasticsearch - Base module for things using elasticsearch >diff --git a/about.pl b/about.pl >index cfc2e32..5a8b65a 100755 >--- a/about.pl >+++ b/about.pl >@@ -42,6 +42,7 @@ use Koha::Patrons; > use Koha::Caches; > use Koha::Config::SysPrefs; > use Koha::Illrequest::Config; >+use Koha::SearchEngine; > use Koha::SearchEngine::Elasticsearch; > > use C4::Members::Statistics; >@@ -316,8 +317,8 @@ if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) { > }; > if ( !$es_config_error ) { > >- my $biblios_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::BIBLIOS_INDEX; >- my $authorities_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::AUTHORITIES_INDEX; >+ my $biblios_index_name = $es_conf->{index_name} . "_" . Koha::SearchEngine::BIBLIOS_INDEX; >+ my $authorities_index_name = $es_conf->{index_name} . "_" . Koha::SearchEngine::AUTHORITIES_INDEX; > > my @indexes = ($biblios_index_name, $authorities_index_name); > # TODO: When new indexes get added, we could have other ways to >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index e78a7d8..1ededd8 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -27,6 +27,7 @@ use C4::Auth; > use C4::Context; > use C4::Acquisition; > use C4::Koha; >+use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > >@@ -71,9 +72,9 @@ if ( $op eq "do_search" ) { > my $resultsperpage = $query->param('resultsperpage') || 20; > > my $builder = Koha::SearchEngine::QueryBuilder->new( >- { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); >+ { index => Koha::SearchEngine::AUTHORITIES_INDEX } ); > my $searcher = Koha::SearchEngine::Search->new( >- { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); >+ { index => Koha::SearchEngine::AUTHORITIES_INDEX } ); > my $search_query = $builder->build_authorities_query_compat( > \@marclist, \@and_or, \@excluding, \@operator, > \@value, $authtypecode, $orderby >diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl >index c991af8..5e3b8d4 100755 >--- a/authorities/authorities-home.pl >+++ b/authorities/authorities-home.pl >@@ -34,6 +34,7 @@ use C4::Biblio; > use C4::Search::History; > > use Koha::Authority::Types; >+use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Token; >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 323457a..4132dfd 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -152,6 +152,7 @@ use C4::Search::History; > use Koha::ItemTypes; > use Koha::Library::Groups; > use Koha::Patrons; >+use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Virtualshelves; >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 8e50202..821795d 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -35,6 +35,7 @@ use C4::Koha; > use C4::Search; > > use Koha::BiblioFrameworks; >+use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > >diff --git a/misc/search_tools/rebuild_elastic_search.pl b/misc/search_tools/rebuild_elastic_search.pl >index bec107d..d10368a 100755 >--- a/misc/search_tools/rebuild_elastic_search.pl >+++ b/misc/search_tools/rebuild_elastic_search.pl >@@ -86,6 +86,7 @@ use Getopt::Long; > use C4::Context; > use Koha::MetadataRecord::Authority; > use Koha::BiblioUtils; >+use Koha::SearchEngine; > use Koha::SearchEngine::Elasticsearch::Indexer; > use MARC::Field; > use MARC::Record; >@@ -136,7 +137,7 @@ if ($index_biblios) { > $records->next(); > } > } >- do_reindex($next, Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX); >+ do_reindex($next, Koha::SearchEngine::BIBLIOS_INDEX); > } > if ($index_authorities) { > _log(1, "Indexing authorities\n"); >@@ -153,7 +154,7 @@ if ($index_authorities) { > $records->next(); > } > } >- do_reindex($next, Koha::SearchEngine::Elasticsearch::AUTHORITIES_INDEX); >+ do_reindex($next, Koha::SearchEngine::AUTHORITIES_INDEX); > } > > sub do_reindex { >diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl >index c1ba8ba..09a453f 100755 >--- a/opac/opac-authorities-home.pl >+++ b/opac/opac-authorities-home.pl >@@ -33,6 +33,7 @@ use C4::Koha; > use C4::Search::History; > > use Koha::Authority::Types; >+use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > >-- >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 16588
:
53636
|
53637
|
53638
|
54477
|
55934
|
55935
|
55936
|
55937
|
56853
|
57516
|
57517
|
57518
|
57519
|
73444
|
73445
|
73446
|
73447
|
73448
|
73449
|
73450
|
73451
| 73452