From 6a321c6ee44413e1e3601d1d9fcd727788e2bb3f Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 5 Jul 2024 13:28:24 +0000 Subject: [PATCH] Bug 37260: Check message broker for both 'about' and 'sysinfo' tabs Test plan: 1) Apply test patch only 2) Visit /cgi-bin/koha/about.pl 3) Notice it shows 'Using RabbitMQ' (it should show 'Using SQL polling') 4) Apply this patch, repeat 3) 5) Notice it now shows 'Using SQL polling' 6) Remove test patch. Notice it shows 'Using RabbitMQ' again. 7) Repeat test plan but for /cgi-bin/koha/about.pl?tab=sysinfo tab Signed-off-by: Jonathan Druart Signed-off-by: Emily Lamancusa Signed-off-by: Martin Renvoize --- about.pl | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/about.pl b/about.pl index 37e400fbb7..3dff63118d 100755 --- a/about.pl +++ b/about.pl @@ -178,6 +178,8 @@ if ( $tab eq 'about' ) { $where_is_memcached_config = 'config_only'; } + message_broker_check($template); + $template->param( effective_caching_method => $effective_caching_method, memcached_servers => $memcached_servers, @@ -672,16 +674,7 @@ if($tab eq 'sysinfo') { $template->param( warnFastCataloging => $no_FA_framework ); } - { - # BackgroundJob - test connection to message broker - eval { - Koha::BackgroundJob->connect; - }; - if ( $@ ) { - warn $@; - $template->param( warnConnectBroker => $@ ); - } - } + message_broker_check($template); #BZ 28267: Warn administrators if there are database rows with a format other than 'DYNAMIC' { @@ -906,4 +899,16 @@ if ( $tab eq 'history' ) { } } +sub message_broker_check { + my $template = shift; + { + # BackgroundJob - test connection to message broker + eval { Koha::BackgroundJob->connect; }; + if ($@) { + warn $@; + $template->param( warnConnectBroker => $@ ); + } + } + } + output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5