[Bug 41818] New: SIP2 message in AF field should be stripped of newlines and carriage returns
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Bug ID: 41818 Summary: SIP2 message in AF field should be stripped of newlines and carriage returns Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: SIP2 Assignee: jake.deery@openfifth.co.uk Reporter: jake.deery@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: hdunne-howrie@westminster.gov.uk SIP2 places patron messages in the AF field, to be displayed on the unit, should a staff member wish them to be seen. The field in the staff client accepts multi-line input, but SIP2 units generally use either newline, carriage return, or both, as an indicator of the end of a message. There should be a message_without_newlines method under Koha::Patron::Message to handle scenarios like this, where the newlines are not desirable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #1 from Jake Deery <jake.deery@openfifth.co.uk> --- Created attachment 192982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192982&action=edit Bug 41818: Add new Koha::Patron::Message method to SIP2 This bug adds Koha::Patron::Message::message_without_newlines, which has been added to C4::SIP::ILS::Patron in lieu of Koha::Patron::Message::message. The aim of this change is to prevent SIP2 units from crashing out when they encounter a patron message with newlines (\n or \r) in it, as units generally use a newline character to denote the end of a SIP2 transaction. To test: a) go to /cgi-bin/koha/sip2/institutions *) create an institution, name CPL, timeout 300, the rest default b) go to /cgi-bin/koha/sip2/accounts *) create an account, userid koha, institution CPL, terminator crlf, the rest default c) go to /cgi-bin/koha/members/moremember.pl?borrowernumber=51 *) click add message in toolbar *) enter some multi-line message e.g. test[RETURN]1[RETURN]2[RETURN]3[RETURN][RETURN][RETURN] d) run tail -f /var/log/koha/kohadev/sip-output.log, keep this window open e) run ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l CPL --patron 42 -m patron_information f) look at the tail log, notice how the MSG 64 line has a newline before the final pipe (|) character == APPLY PATCH == g) restart_all h) repeat steps e-f i) notice how in the tail log, the MSG 64 line now has the final pipe character contiguously placed with the successive characters == SIGN OFF == -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Jake Deery <jake.deery@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- I'm not seeing the behavour described in the bug: Before the patch: [2026/02/17 03:07:09] [7858] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 030709000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreetings from Koha. |' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327) After the patch: [2026/02/17 03:14:47] [9097] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 031447000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreetings from Koha. |' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327) Message added shows in the staff interface as: 02/17/2026 Centerville - Staff note ( koha ) "test 1 2 3 " -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192982|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 193285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193285&action=edit Bug 41818: Add new Koha::Patron::Message method to SIP2 This bug adds Koha::Patron::Message::message_without_newlines, which has been added to C4::SIP::ILS::Patron in lieu of Koha::Patron::Message::message. The aim of this change is to prevent SIP2 units from crashing out when they encounter a patron message with newlines (\n or \r) in it, as units generally use a newline character to denote the end of a SIP2 transaction. To test: a) go to /cgi-bin/koha/sip2/institutions *) create an institution, name CPL, timeout 300, the rest default b) go to /cgi-bin/koha/sip2/accounts *) create an account, userid koha, institution CPL, terminator crlf, the rest default c) go to /cgi-bin/koha/members/moremember.pl?borrowernumber=51 *) click add message in toolbar *) enter some multi-line message e.g. test[RETURN]1[RETURN]2[RETURN]3[RETURN][RETURN][RETURN] d) run tail -f /var/log/koha/kohadev/sip-output.log, keep this window open e) run ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l CPL --patron 42 -m patron_information f) look at the tail log, notice how the MSG 64 line has a newline before the final pipe (|) character == APPLY PATCH == g) restart_all h) repeat steps e-f i) notice how in the tail log, the MSG 64 line now has the final pipe character contiguously placed with the successive characters == SIGN OFF == Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #4 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #2)
I'm not seeing the behavour described in the bug:
Before the patch:
[2026/02/17 03:07:09] [7858] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 030709000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreet ings from Koha. |' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327)
After the patch:
[2026/02/17 03:14:47] [9097] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 031447000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreet ings from Koha. |' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327)
Message added shows in the staff interface as:
02/17/2026 Centerville - Staff note ( koha ) "test 1 2 3
"
I retested and added the note in step C as a "OAPC - koha", instead of a "Staff - Internal note". Before the patch: [2026/02/17 03:24:30] [11715] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 032430000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreetings from Koha. Messages for you: 02/17/2026: test 1 2 3 |' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327) After the patch: [2026/02/17 03:23:27] [10927] [INFO] koha@127.0.0.1: OUTPUT MSG: '64 00120260217 032327000000000000000000000000AOCPL|AA42|AE|BLY|BHUSD|BV0|CC5|PCS|PIY|AFGreetings from Koha. Messages for you: 02/17/2026: test 1 2 3|' C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (327) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193285|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193530&action=edit Bug 41818: Add new Koha::Patron::Message method to SIP2 This bug adds Koha::Patron::Message::message_without_newlines, which has been added to C4::SIP::ILS::Patron in lieu of Koha::Patron::Message::message. The aim of this change is to prevent SIP2 units from crashing out when they encounter a patron message with newlines (\n or \r) in it, as units generally use a newline character to denote the end of a SIP2 transaction. To test: a) go to /cgi-bin/koha/sip2/institutions *) create an institution, name CPL, timeout 300, the rest default b) go to /cgi-bin/koha/sip2/accounts *) create an account, userid koha, institution CPL, terminator crlf, the rest default c) go to /cgi-bin/koha/members/moremember.pl?borrowernumber=51 *) click add message in toolbar *) enter some multi-line message e.g. test[RETURN]1[RETURN]2[RETURN]3[RETURN][RETURN][RETURN] d) run tail -f /var/log/koha/kohadev/sip-output.log, keep this window open e) run ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l CPL --patron 42 -m patron_information f) look at the tail log, notice how the MSG 64 line has a newline before the final pipe (|) character == APPLY PATCH == g) restart_all h) repeat steps e-f i) notice how in the tail log, the MSG 64 line now has the final pipe character contiguously placed with the successive characters == SIGN OFF == Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193532 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193532&action=edit Bug 41818: Add unit tests Patch from commit 2e158b8 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #7 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |lucas@bywatersolutions.com --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Add release notes, please. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #9 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00,25.11.04 |26.05.00,25.11.04,25.05.11 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #10 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 --- Comment #11 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Correction: this was pushed for 25.05.11. --LE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting CC| |baptiste.wojtkowski@biblibr | |e.com Version(s)|26.05.00,25.11.04,25.05.11 |26.05.00,25.11.04,25.05.11, released in| |24.11.16 --- Comment #12 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 24.11.x for 24.11.16 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41818 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED --- Comment #13 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org