Bug 37582 - SIP2 responses can contain newlines when a patron has multiple debarments
Summary: SIP2 responses can contain newlines when a patron has multiple debarments
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-06 17:17 UTC by Nick Clemens (kidclamp)
Modified: 2024-09-17 18:53 UTC (History)
1 user (show)

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


Attachments
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces (9.42 KB, patch)
2024-09-17 18:46 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces (9.52 KB, patch)
2024-09-17 18:53 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 37582: Tidy write_msg (1.63 KB, patch)
2024-09-17 18:53 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-08-06 17:17:00 UTC
This came up with a SIP vendor recently - when reading responses they were only getting part of a patron's information. It seemed to have been caused by patrons with multiple restrictions and a new line in the response

The simple fix was:
<screen_msg_regex find="\n" replace=" -- " />

We should possibly add this as an option rather than relying on regex
Comment 1 Kyle M Hall (khall) 2024-09-17 18:46:48 UTC
Created attachment 171642 [details] [review]
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces

This came up with a SIP vendor recently - when reading responses they were only getting part of a patron's information.
It seemed to have been caused by patrons with multiple restrictions and a new line in the response

Test Plan:
1) Add multiple debarments to a patron
2) Run a sip patron information response, note the presence of newlines
3) Apply this patch
4) Add the new option convert_control_characters to your SIP account,
   set the value to " -- "
5) Restart all the things!
7) Run a sip patron information response, note the newlines have been replaced!
Comment 2 Kyle M Hall (khall) 2024-09-17 18:53:20 UTC
Created attachment 171643 [details] [review]
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces

This came up with a SIP vendor recently - when reading responses they were only getting part of a patron's information.
It seemed to have been caused by patrons with multiple restrictions and a new line in the response

This patch also does minor refactoring to write_msg to pass the server variable that contains
all the previously passed parameters, and removes the never used "file" parameter.

Test Plan:
1) Add multiple debarments to a patron
2) Run a sip patron information response, note the presence of newlines
3) Apply this patch
4) Add the new option convert_control_characters to your SIP account,
   set the value to " -- "
5) Restart all the things!
7) Run a sip patron information response, note the newlines have been replaced!
Comment 3 Kyle M Hall (khall) 2024-09-17 18:53:26 UTC
Created attachment 171644 [details] [review]
Bug 37582: Tidy write_msg