From b34060d5e08e13cd207fb79b25409cad967ec1ee Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 May 2026 13:48:18 +0200 Subject: [PATCH] Bug 42453: Prevent 500 on the about page if elastic is not runing If the elastic countainer is stopped, the about page crashes with a 500 "No nodes are available" Test plan: Startup ktd with `--search-engine es8` Go to the about page Notice that the "Elasticsearch" line contains the version and "running" Stop the es container: `docker start koha-es-1` Refresh the about page => Without this patch you get the 500 => With this patch applied the page is rendered with: "Version: Unkown" and "Status: not running" Signed-off-by: David Nind Signed-off-by: Lisette Scheer Signed-off-by: Lucas Gass (cherry picked from commit fc66bac9b0118ea533c35c40c696d1029d7d66f4) Signed-off-by: Baptiste Wojtkowski --- about.pl | 4 +++- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/about.pl b/about.pl index 9b116cf1ff..c9ba5390d5 100755 --- a/about.pl +++ b/about.pl @@ -891,7 +891,6 @@ sub elasticsearch_check { # fetch the list of available indexes (e.g. plugins, etc) $es_status->{nodes} = $es_conf->{nodes}; my $es = Search::Elasticsearch->new($es_conf); - my $es_status->{version} = $es->info->{version}->{number}; foreach my $index (@indexes) { my $index_count; @@ -930,6 +929,9 @@ sub elasticsearch_check { }; } $es_status->{running} = $es_running; + if ($es_running) { + $es_status->{version} = $es->info->{version}->{number}; + } $template->param( elasticsearch_status => $es_status, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 5e8b4d2fdb..773f1096cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -142,7 +142,7 @@ [% END %] Version: - [% elasticsearch_status.version | html %] + [% elasticsearch_status.version || t("Unknown") | html %] | Nodes: [% elasticsearch_status.nodes.join(' / ') | html %]