Bug 15751

Summary: Koha offline circulation Firefox addon does not update last seen date for check-ins
Product: Koha Reporter: Owen Leonard <oleonard>
Component: CirculationAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: 1joynelson, alex.arnaud, black23, fridolin.somers, gmcharlt, jonathan.druart, koha-bugs, kyle.m.hall, lucas, m.de.rooy, magnus, martin.renvoize, sandboxes, testopia, veron
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21494
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Bug Depends on:    
Bug Blocks: 26209    
Attachments: Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Description Owen Leonard 2016-02-05 19:05:29 UTC
When I check in something using the KOCT the last seen date is not updated.

It does update the last seen date upon checkout, for what it's worth.
Comment 1 Alex Arnaud 2017-12-05 16:48:21 UTC
It's clear for me that the problem exists on Koha side. It seems that ProcessOfflineReturn use MarkIssueReturned and not AddReturn (which do the ModDateLastSeen). I wonder why there is 2 subs handling checkin and not one...
Comment 2 Martin Renvoize 2019-12-11 11:55:51 UTC
Created attachment 96201 [details] [review]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.
Comment 3 Martin Renvoize 2019-12-11 11:56:57 UTC
The reason for two subs is that a KOCT transaction cannot deal with the error cases that AddReturn can throw.. as such we perform the actual return regardless of any normal error cases.
Comment 4 Martin Renvoize 2019-12-11 12:14:48 UTC
Created attachment 96203 [details] [review]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.
Comment 5 Jonathan Druart 2019-12-16 09:55:32 UTC
I am wondering if the fix is not to use AddReturn instead of MarkIssueReturned. See also bug 21494 and https://lists.koha-community.org/pipermail/koha-devel/2019-December/045432.html
Comment 6 Magnus Enger 2020-03-23 19:45:19 UTC
Looking at signing off this. 

Tempted to set it to "in discussion" because of comment 5, but I think Martin sort of answered it in comment 3?

Then I see there are no tests for ProcessOfflineReturn, and not for ProcessOfflineIssue or ProcessOfflinePayment either. But asking for that might be a bit too much on this bug?
Comment 7 Biblibre Sandboxes 2020-04-10 10:17:12 UTC
Patch tested with a sandbox, by Laurence Rault <laurence.rault@biblibre.com>
Comment 8 Biblibre Sandboxes 2020-04-10 10:17:34 UTC
Created attachment 102692 [details] [review]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Comment 9 Marcel de Rooy 2020-05-01 08:37:46 UTC
Created attachment 104074 [details] [review]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Martin Renvoize 2020-05-01 09:01:48 UTC
(In reply to Magnus Enger from comment #6)
> Looking at signing off this. 
> 
> Tempted to set it to "in discussion" because of comment 5, but I think
> Martin sort of answered it in comment 3?
> 
> Then I see there are no tests for ProcessOfflineReturn, and not for
> ProcessOfflineIssue or ProcessOfflinePayment either. But asking for that
> might be a bit too much on this bug?

Adding tests would certainly be preferable.. I'm going to keep this one in my queue and attempt to write tests as part of push.
Comment 11 Martin Renvoize 2020-05-04 07:41:47 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Joy Nelson 2020-05-08 23:00:22 UTC
backported to 19.11.x for 19.11.06
Comment 13 Lucas Gass 2020-05-15 17:31:32 UTC
backported to 19.05.x for 19.05.11