Bugzilla – Attachment 179585 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.47 KB, created by
Kyle M Hall (khall)
on 2025-03-21 11:11:59 UTC
(
hide
)
Description:
Bug 39407: Prevent SIP from crashing due to lack of active currency
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-03-21 11:11:59 UTC
Size:
1.47 KB
patch
obsolete
>From 4e38482d9cb2329d66c109ea3c3d83823e2316ae 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! >--- > 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 f51cf63cbd4..a5a84b572f8 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.39.5 (Apple Git-154)
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