From 8cbe6a740ceb9d1529da6cc9ae8ff681d8f924fd Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 21 Apr 2020 12:14:13 +0100 Subject: [PATCH] Bug 20484: (RM follow-up) Highlight ES disablement Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- admin/searchengine/elasticsearch/mappings.pl | 5 ++++- .../en/modules/admin/searchengine/elasticsearch/mappings.tt | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl index 52ec372ffc..54e53366f3 100755 --- a/admin/searchengine/elasticsearch/mappings.pl +++ b/admin/searchengine/elasticsearch/mappings.pl @@ -34,7 +34,8 @@ use Module::Load::Conditional qw(can_load); my $input = new CGI; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( - { template_name => 'admin/searchengine/elasticsearch/mappings.tt', + { + template_name => 'admin/searchengine/elasticsearch/mappings.tt', query => $input, type => 'intranet', authnotrequired => 0, @@ -50,6 +51,8 @@ unless ( can_load( modules => { 'Koha::SearchEngine::Elasticsearch::Indexer' => my $index = $input->param('index') || 'biblios'; my $op = $input->param('op') || 'list'; my @messages; +push @messages, { type => 'message', code => 'elasticsearch_disabled' } + if ( C4::Context->preference('SearchEngine') ne 'Elasticsearch' ); my $database = Koha::Database->new(); my $schema = $database->schema; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index 4c9c5865d0..bf6d73d2fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -97,6 +97,8 @@ a.add, a.delete { [% t("Mappings updated successfully.") | $raw %] [% CASE 'success_on_reset' %] [% t("Mappings have been reset successfully.") | $raw %] + [% CASE 'elasticsearch_disabled' %] + [% t("Elasticsearch is currently disabled.") | $raw %] [% CASE %] [% m.code | html %] [% END %] -- 2.39.5