Bugzilla – Attachment 180062 Details for
Bug 39407
Having no active currency defined breaks SIP silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39407: Prevent SIP from crashing due to lack of active currency
Bug-39407-Prevent-SIP-from-crashing-due-to-lack-of.patch (text/plain), 1.50 KB, created by
Magnus Enger
on 2025-03-31 14:38:29 UTC
(
hide
)
Description:
Bug 39407: Prevent SIP from crashing due to lack of active currency
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2025-03-31 14:38:29 UTC
Size:
1.50 KB
patch
obsolete
>From b71b4ec42ddd9c10bec8b9505b12eff6e6007b40 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 21 Mar 2025 07:01:39 -0400 >Subject: [PATCH] Bug 39407: Prevent SIP from crashing due to lack of active > currency > >In the staff interface, in most areas of Koha that require an active currency to be defined, a large info box appears to let the user know there is no active currency defined. Our SIP code presumes an active currency and if one is not defined, any SIP messages utilizing C4::SIP::ILS::Patron will crash with no errors such that a response is never transmitted for the request. > >Test Plan: >1) Apply the unit test patch >2) prove t/db_dependent/SIP/Patron.t Fails! >3) Apply the second patch >4) prove t/db_dependent/SIP/Patron.t Succeeds! > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >--- > C4/SIP/ILS/Patron.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index f51cf63cbd..a5a84b572f 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -126,7 +126,8 @@ sub new { > } > > # Get currency 3 chars max >- my $currency = substr Koha::Acquisition::Currencies->get_active->currency, 0, 3; >+ my $active_currency = Koha::Acquisition::Currencies->get_active; >+ my $currency = $active_currency ? substr( $active_currency->currency, 0, 3 ) : q{}; > > my $circ_blocked = > ( C4::Context->preference('OverduesBlockCirc') ne "noblock" && defined $flags->{ODUES}->{itemlist} ) ? 1 : 0; >-- >2.34.1
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 39407
:
179583
|
179584
|
179585
|
180060
|
180061
| 180062