Bug 39407 - Having no active currency defined breaks SIP silently
Summary: Having no active currency defined breaks SIP silently
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-21 10:51 UTC by Kyle M Hall (khall)
Modified: 2025-04-18 09:14 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39407: Add unit test to prove no active currency crashes SIP (1.64 KB, patch)
2025-03-21 11:05 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39407: Add unit test to prove no active currency crashes SIP (1.64 KB, patch)
2025-03-21 11:11 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39407: Prevent SIP from crashing due to lack of active currency (1.47 KB, patch)
2025-03-21 11:11 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39407: Prevent SIP from crashing due to lack of active currency (1.50 KB, patch)
2025-03-31 14:36 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 39407: Add unit test to prove no active currency crashes SIP (1.68 KB, patch)
2025-03-31 14:38 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 39407: Prevent SIP from crashing due to lack of active currency (1.50 KB, patch)
2025-03-31 14:38 UTC, Magnus Enger
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2025-03-21 10:51:19 UTC
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.
Comment 1 Kyle M Hall (khall) 2025-03-21 11:05:21 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2025-03-21 11:11:53 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall (khall) 2025-03-21 11:11:59 UTC Comment hidden (obsolete)
Comment 4 Magnus Enger 2025-03-31 14:36:50 UTC Comment hidden (obsolete)
Comment 5 Magnus Enger 2025-03-31 14:38:16 UTC
Created attachment 180061 [details] [review]
Bug 39407: Add unit test to prove no active currency crashes SIP

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 6 Magnus Enger 2025-03-31 14:38:29 UTC
Created attachment 180062 [details] [review]
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>
Comment 7 Marcel de Rooy 2025-04-18 09:13:50 UTC
I ran the test without the second patch. And was surprised to see:
# Subtest: new tests
    1..6
    ok 1 - Found patron via cardnumber scalar
    ok 2 - Found patron via userid scalar
    ok 3 - Found patron via borrowernumber hashref
    ok 4 - Found patron via cardnumber hashref
    ok 5 - Found patron via userid hashref
    ok 6 - Found patron when  no active currency is defined
ok 3 - new tests

Please clarify.