Bug 37260: Check message broker for both 'about' and 'sysinfo' tabs

Test plan:
1) Apply test patch only
2) Visit <staff_url>/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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Pedro Amorim 2024-07-05 13:28:24 +00:00 committed by Martin Renvoize
parent 554efbe354
commit 6a321c6ee4
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 15 additions and 10 deletions

View File

@ -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;