Bugzilla – Attachment 177638 Details for
Bug 38988
If JobsNotificationMethod is not STOMP the about page shows as if there was a problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38988: Make the polling use case be normal in about page
Bug-38988-Make-the-polling-use-case-be-normal-in-a.patch (text/plain), 4.30 KB, created by
Nick Clemens (kidclamp)
on 2025-02-07 16:07:47 UTC
(
hide
)
Description:
Bug 38988: Make the polling use case be normal in about page
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-02-07 16:07:47 UTC
Size:
4.30 KB
patch
obsolete
>From 37cd8095bbb55246a333a820acae3434434cf809 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 28 Jan 2025 14:48:54 -0300 >Subject: [PATCH] Bug 38988: Make the polling use case be normal in about page > >This patch makes choosing `polling` for the `JobsNotificationMethod` >system preference not be considered problematic or different than >`STOMP`. > >To test: >1. In `KTD` make sure you have `STOMP` selected >2. Make sure rabbitmq is running: > $ ktd --shell > k$ sudo -s > $ service rabbitmq-server start >3. Go to the about page, 'Server information' >=> SUCCESS: 'Using RabbitMQ' displayed >4. Stop rabbit > $ service rabbitmq-server stop >5. Repeat 3 >=> SUCCESS: Using Rabbit but fallback to polling >6. Go to the 'System information' tab >=> SUCCESS: Error message about the broker not functional >7. Choose 'polling' >8. Repeat 3 >=> FAIL: It says 'Using SQL polling' but in bold face <.< >9. Repeat 6 >=> FAIL: There's an error about the broker, which we explicitly asked >not to use <.< >10. Apply this patch >11. Repeat 3 >=> SUCCESS: Nothing weird, 'Using SQL polling' displayed. >12. Repeat 6 >=> SUCCESS: No weird error about the broker. >13. Switch to 'STOMP' >=> SUCCESS: Behavior is the same with/without rabbit running >14. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > about.pl | 24 ++++++++----------- > .../intranet-tmpl/prog/en/modules/about.tt | 10 ++++---- > 2 files changed, 16 insertions(+), 18 deletions(-) > >diff --git a/about.pl b/about.pl >index afb58e95556..7b6de763278 100755 >--- a/about.pl >+++ b/about.pl >@@ -178,7 +178,7 @@ if ( $tab eq 'about' ) { > $where_is_memcached_config = 'config_only'; > } > >- message_broker_check($template); >+ job_notification_method_check($template); > elasticsearch_check($template); > > $template->param( >@@ -606,7 +606,7 @@ if($tab eq 'sysinfo') { > $template->param( warnFastCataloging => $no_FA_framework ); > } > >- message_broker_check($template); >+ job_notification_method_check($template); > > #BZ 28267: Warn administrators if there are database rows with a format other than 'DYNAMIC' > { >@@ -909,22 +909,18 @@ sub elasticsearch_check { > } > } > >-sub message_broker_check { >- my $template = shift; >- { >+sub job_notification_method_check { >+ my ($template) = @_; >+ >+ if ( C4::Context->preference('JobsNotificationMethod') eq 'STOMP' ) { >+ > # BackgroundJob - test connection to message broker > my $conn = Koha::BackgroundJob->connect; >- if (! $conn) { >- if (C4::Context->preference('JobsNotificationMethod') eq 'STOMP' ) { >- $template->param( warnConnectBroker => 'Error connecting' ); >- } else { >- $template->param( >- warnConnectBroker => C4::Context->preference('JobsNotificationMethod') >- ); >- } >+ if ( !$conn ) { >+ $template->param( warnConnectBroker => 1 ); > } > } >- } >+} > > if ( $tab eq 'database' ) { > use Koha::Database::Auditor; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 309b9c69ac1..642879d21c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -205,12 +205,14 @@ > </tr> > <tr> > <th scope="row">Message broker: </th> >- [% IF warnConnectBroker == 'Error connecting' %] >+ [% IF warnConnectBroker %] > <td class="text-bg-warning"><strong>Using SQL polling (Fallback, Error connecting to RabbitMQ)</strong></td> >- [% ELSIF warnConnectBroker %] >- <td class="text-bg-warning"><strong>Using SQL polling</strong></td> > [% ELSE %] >- <td class="text-bg-info">Using RabbitMQ</td> >+ [% IF Koha.Preference('JobsNotificationMethod') == 'polling' %] >+ <td class="text-bg-info">Using SQL polling</td> >+ [% ELSE %] >+ <td class="text-bg-info">Using RabbitMQ</td> >+ [% END %] > [% END %] > </tr> > <tr> >-- >2.39.5
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 38988
:
177286
|
177307
| 177638