Bug 12467

Summary: Lost items marked as not on loan even if they are!
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall (khall) <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 12467 - Lost items marked as not on loan even if they are!
[SIGNED-OFF] Bug 12467 - Lost items marked as not on loan even if they are!
[PASSED QA] Bug 12467 - Lost items marked as not on loan even if they are!
Bug 12467 [QA Followup] - Unit Tests
Bug 12467 [QA Followup] - Unit Tests

Description Kyle M Hall (khall) 2014-06-23 15:41:26 UTC
The cronjob longoverdue.pl does not require that an item marked as lost be returned automatically, but there is a line in ModItem that automatically marks the item's onloan as false if itemlost is set!
Comment 1 Kyle M Hall (khall) 2014-06-23 16:45:28 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-08-13 16:56:17 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-08-17 18:47:23 UTC
This does what it claims to do, but I am a bit confused. I wanted to do the opposite and prove that the onloan is removed when I use  --mark-returned - but the item is only marked as lost and never returned. Is this another bug?
Comment 4 Katrin Fischer 2014-08-17 18:59:37 UTC
Created attachment 30897 [details] [review]
[PASSED QA] Bug 12467 - Lost items marked as not on loan even if they are!

The cronjob longoverdue.pl does not require that an item marked as lost
be returned automatically, but there is a line in ModItem that
automatically marks the item's onloan as false if itemlost is set!

Test Plan:
1) Mark an item as lost with longoverdue.pl, without --mark-returned
2) Inspect the db, note that items.onloan is now 0
3) Apply this patch
4) Mark repeat step 1
5) Inspect the db, noe that items.onloan is still 1
6) Test marking an item as lost from staff interface,
   ensure there are no regressions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works according to test plan and fixes a data loss bug.

Some notes:
- This patch would be nicer with a regression test.
- Also checked that returning the item removes lost status and onloan still.
- Tried to test with --mark-returned, but couldn't get it to
  return my item neither with nor without the patch. (see comment on
  bug report)
Comment 5 Kyle M Hall (khall) 2014-08-18 16:05:00 UTC
That would definitely be a bug! Please file a separate bug report for that!

(In reply to Katrin Fischer from comment #3)
> This does what it claims to do, but I am a bit confused. I wanted to do the
> opposite and prove that the onloan is removed when I use  --mark-returned -
> but the item is only marked as lost and never returned. Is this another bug?
Comment 6 Tomás Cohen Arazi (tcohen) 2014-08-24 15:37:37 UTC
Can we have some regression tests for this one?
Comment 7 Katrin Fischer 2014-08-24 20:20:01 UTC
(In reply to Kyle M Hall from comment #5)
> That would definitely be a bug! Please file a separate bug report for that!
> 
> (In reply to Katrin Fischer from comment #3)
> > This does what it claims to do, but I am a bit confused. I wanted to do the
> > opposite and prove that the onloan is removed when I use  --mark-returned -
> > but the item is only marked as lost and never returned. Is this another bug?

I filed bug 12812.
Comment 8 Kyle M Hall (khall) 2014-08-28 17:47:43 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall (khall) 2014-08-28 17:51:33 UTC
Created attachment 31266 [details] [review]
Bug 12467 [QA Followup] - Unit Tests
Comment 10 Tomás Cohen Arazi (tcohen) 2014-09-08 15:42:29 UTC
Patches pushed to master.

Thanks Kyle!