Bug 12311 - Batch modification of checked out and lost items checks them in
Summary: Batch modification of checked out and lost items checks them in
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 5533
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-23 16:38 UTC by Owen Leonard
Modified: 2016-06-21 21:38 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 12311: Do not return a lost item if modified in a batch (1.50 KB, patch)
2015-09-15 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 12311: Do not return a lost item if modified in a batch (1.94 KB, patch)
2015-09-22 17:09 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[PASSED QA] Bug 12311: Do not return a lost item if modified in a batch (2.19 KB, patch)
2015-09-29 21:08 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2014-05-23 16:38:29 UTC
If you use the batch modification tool to change details of an item which is checked out and lost the item is checked in. To reproduce:

1. Identify items which are checked out and lost.
2. Submit these items for batch modification.
3. Choose any field to modify: collection code, item type, price, etc.
4. Complete the modifications.
5. Confirm that these items are no longer checked out.
Comment 1 Jonathan Druart 2015-07-10 15:58:18 UTC
It seems that this behavior exists for a while.
There was a discussion on bug 5533 and I am not sure how we should fix this bug.

bug 5533 comment 2:
"Another update - if you mark items lost using the batch edit tool the lost items remain on the patron's record as checked out instead of being removed."

I am sure it's easy to fix, but I would like to know the different use cases to take into account.
Comment 2 Jonathan Druart 2015-07-10 15:59:20 UTC
The code is:

200 if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {              
201      LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost};
202 }
Comment 3 Jonathan Druart 2015-08-19 14:22:38 UTC
I need help on this one to provide a fix.
Comment 4 Jonathan Druart 2015-09-15 09:43:41 UTC
ping?
Is this really critical?
Comment 5 Katrin Fischer 2015-09-15 09:49:51 UTC
I think yes. If it's true it unexpectedly checks items in, then that's really bad.

I think the problem might be that Koha ususally wants to return an item if it's set to lost... and only the longoverdue script manages to avoid this?

What about: only trigger the check in, if the lost status is changed in the batch edit?
Comment 6 Jonathan Druart 2015-09-15 10:48:10 UTC Comment hidden (obsolete)
Comment 7 Héctor Eduardo Castro Avalos 2015-09-22 17:09:30 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2015-09-29 21:08:05 UTC
Created attachment 42961 [details] [review]
[PASSED QA] Bug 12311: Do not return a lost item if modified in a batch

If a item is lost and issued, and you modify it in a batch, the item
will be marked as returned. It should only be returned if the item is
marked as lost.

Test plan:
1/ Check an item out and mark it as lost
2/ Edit it in a batch (tools/batchMod.pl) and edit a field (notes for
instance)
3/ The item should still be issued to the patron
4/ Edit it in a batch and edit the lost value, marked it as not lost
5/ The item should still be issued to the patron
6/ Edit it in a batch and edit the lost value, marked it as lost
7/ The item should have been returned.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Just one comment, lost status can be changed only if you change default framework to another framework then edit the item. If you change it in Item menu at left side of screen this will remove the item from patron’s checkouts and patron charged for lost item.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
For testing purposes the lost item field can be set to visible
in the framework used. That will allow changing it without
returning it at the same time.
The other option is using the longoverdues.pl script.
Comment 9 Tomás Cohen Arazi 2015-10-02 15:09:59 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 10 Chris Cormack 2015-10-11 20:53:24 UTC
Pushed to 3.20.x will be in 3.20.5
Comment 11 Liz Rea 2015-11-02 21:02:38 UTC
Pushed to 3.18.x, is in 3.18.12.