Bug 12467 - Lost items marked as not on loan even if they are!
Summary: Lost items marked as not on loan even if they are!
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-23 15:41 UTC by Kyle M Hall
Modified: 2015-06-04 23:33 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12467 - Lost items marked as not on loan even if they are! (1.64 KB, patch)
2014-06-23 16:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12467 - Lost items marked as not on loan even if they are! (1.74 KB, patch)
2014-08-13 16:56 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 12467 - Lost items marked as not on loan even if they are! (2.09 KB, patch)
2014-08-17 18:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 12467 [QA Followup] - Unit Tests (1.81 KB, patch)
2014-08-28 17:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12467 [QA Followup] - Unit Tests (1.82 KB, patch)
2014-08-28 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 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 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 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 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 2014-08-28 17:47:43 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2014-08-28 17:51:33 UTC
Created attachment 31266 [details] [review]
Bug 12467 [QA Followup] - Unit Tests
Comment 10 Tomás Cohen Arazi 2014-09-08 15:42:29 UTC
Patches pushed to master.

Thanks Kyle!