Bug 25227

Summary: SIP server returns wrong error message if item was lost and not checked out
Product: Koha Reporter: Kyle M Hall <kyle>
Component: SIP2Assignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, colin.campbell, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06
Attachments: Bug 25227: SIP server returns wrong error message if item was lost and not checked out
Bug 25227: SIP server returns wrong error message if item was lost and not checked out
Bug 25227: Display correct message if item is lost and lost returns are allowed
1 Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Bug 25227: Add unit tests
Bug 25227: Display correct message if item is lost and lost returns are allowed
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Bug 25227: Add unit tests
Bug 25227: Display correct message if item is lost and lost returns are allowed
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed

Description Kyle M Hall 2020-04-21 11:10:57 UTC
Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.
Comment 1 Kyle M Hall 2020-04-21 11:13:43 UTC
Created attachment 103363 [details] [review]
Bug 25227: SIP server returns wrong error message if item was lost and not checked out

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!
Comment 2 Frédéric Demians 2020-04-27 07:39:05 UTC
Created attachment 103739 [details] [review]
Bug 25227: SIP server returns wrong error message if item was lost and not checked out

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 3 Jonathan Druart 2020-04-27 10:17:45 UTC
What about BlockReturnOfWithdrawnItems then?

Also I think we should stop adding code to C4::SIP without cover the changes by tests.
Comment 4 Kyle M Hall 2020-04-27 11:07:54 UTC
Created attachment 103757 [details] [review]
Bug 25227: Display correct message if item is lost and lost returns are allowed

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 5 Kyle M Hall 2020-04-27 11:08:05 UTC
Created attachment 103758 [details] [review]
1 Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Comment 6 Kyle M Hall 2020-04-27 12:06:32 UTC
Created attachment 103762 [details] [review]
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Comment 7 Kyle M Hall 2020-04-27 12:29:46 UTC
Created attachment 103764 [details] [review]
Bug 25227: Add unit tests
Comment 8 Kyle M Hall 2020-04-27 12:30:24 UTC
Created attachment 103765 [details] [review]
Bug 25227: Display correct message if item is lost and lost returns are allowed

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 9 Kyle M Hall 2020-04-27 12:30:27 UTC
Created attachment 103766 [details] [review]
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed
Comment 10 Jonathan Druart 2020-04-27 12:38:09 UTC
Created attachment 103770 [details] [review]
Bug 25227: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2020-04-27 12:38:13 UTC
Created attachment 103771 [details] [review]
Bug 25227: Display correct message if item is lost and lost returns are allowed

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2020-04-27 12:38:16 UTC
Created attachment 103772 [details] [review]
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Martin Renvoize 2020-04-29 15:25:25 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 14 Joy Nelson 2020-05-08 22:11:32 UTC
Backported to 19.11.x for 19.11.06