Bug 38894 - Longoverdue cron should follow HomeOrHoldingBranch as well as CircControl when using --library flag
Summary: Longoverdue cron should follow HomeOrHoldingBranch as well as CircControl whe...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Andrew Fuerste-Henry
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 9596
Blocks: 38893
  Show dependency treegraph
 
Reported: 2025-01-14 19:21 UTC by Andrew Fuerste-Henry
Modified: 2025-04-22 20:28 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
When the longoverdue cron is limited by library, it follows the CircControl system preference. When CircControl is set to "the item's library," this patch allows the HomeOrHoldingBranch system preference to further specify either the item's homebranch or the item's holdingbranch. This makes the longoverdue cron consistent with the application or circulation and fine rules.
Version(s) released in:
25.05.00,24.11.04
Circulation function:


Attachments
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob (3.11 KB, patch)
2025-01-14 19:50 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob (3.18 KB, patch)
2025-01-22 09:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2025-01-14 19:21:27 UTC
Marking this Critical as it will lead to circ rules getting applied in unexpected ways.

Bug 9596 taught the longoverdue cron to limit by library, following the CircControl system preference. Elsewhere in circulation (due dates, fines, etc), when CircControl is set to "the item's library," then it is further modified by HomeOrHoldingBranch, which determines whether we mean "the item's home" or "the item's holding."

Currently, if CircControl is set to "the item's library," it is *always* interpretted as the item's homebranch. This will not work for many libraries.
Comment 1 Andrew Fuerste-Henry 2025-01-14 19:50:42 UTC
Created attachment 176534 [details] [review]
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob

To test:
1: have 4 items, 2 with homebranch = Library A and 2 with homebranch = Library B
2: Logged into Library A, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
3: set yourself to Library B, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
4: Run longoverdue cron with --verbose, without --confirm, and without --Library. see that it would act on all 4 items
5: Set CircControl to "the library the item is from"
6: Set HomeOrHoldingBranch to "the item's home library"
7: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
8: See the cron wants to act on the items with homebranch = A
9: Set HomeOrHoldingBranch to "the item's holding library"
10: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
11: See the cron is still trying to act on the two items with homebranch = A
12: Apply patch, restart all
13: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
14: See the cron is now trying to act on the two items with holdingbranch = A
15: Set HomeOrHoldingBranch to "the item's home library"
16: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
17: See the cron wants to act on the items with homebranch = A
Comment 2 Martin Renvoize (ashimema) 2025-01-22 09:20:42 UTC
Created attachment 176888 [details] [review]
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob

To test:
1: Add 4 items, 2 with homebranch = Library A and 2 with homebranch = Library B
2: Logged into Library A, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
3: Set yourself to Library B, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
4: Run longoverdue cron with --verbose, without --confirm, and without --Library. see that it would act on all 4 items
5: Set CircControl to "the library the item is from"
6: Set HomeOrHoldingBranch to "the item's home library"
7: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
8: See the cron wants to act on the items with homebranch = A
9: Set HomeOrHoldingBranch to "the item's holding library"
10: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
11: See the cron is still trying to act on the two items with homebranch = A
12: Apply patch, restart all
13: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
14: See the cron is now trying to act on the two items with holdingbranch = A
15: Set HomeOrHoldingBranch to "the item's home library"
16: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
17: See the cron wants to act on the items with homebranch = A

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2025-01-22 09:21:22 UTC
Quick QA of this one, all working well and scripts are happy.
Comment 4 Katrin Fischer 2025-01-24 10:27:28 UTC
A summary of this change might be helpful! Thanks!
Comment 5 Katrin Fischer 2025-01-24 11:03:41 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Paul Derscheid 2025-04-22 20:28:06 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.04