Bug 40771 - Wrong transfer breaking check in for holds when using library transfer limits
Summary: Wrong transfer breaking check in for holds when using library transfer limits
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on: 39750
Blocks:
  Show dependency treegraph
 
Reported: 2025-09-08 21:33 UTC by Nick Clemens (kidclamp)
Modified: 2025-12-17 14:46 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40771: Fix error in the case of AutoFill (1.82 KB, patch)
2025-12-17 14:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40771: Fix transfer error when not auto filling hold (1.40 KB, patch)
2025-12-17 14:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40771: Fix error in the case of AutoFill (1.88 KB, patch)
2025-12-17 14:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40771: Fix transfer error when not auto filling hold (1.45 KB, patch)
2025-12-17 14:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-09-08 21:33:17 UTC
Bug 39750 fixed the case of a transfer with no hold - it seems the same problem can occur when the transfer is for a hold:


Line 178 of returns.pl
        my $hold = Koha::Holds->find($reserve_id);
        if ($diffBranchSend) {
            my $tobranch = $hold->pickup_library();

            # Add transfer, enqueue if one is already in the queue, and immediately set to in transit
            my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } );
            $transfer->transit;
        }
Comment 1 Nick Clemens (kidclamp) 2025-12-17 14:35:14 UTC
Created attachment 190585 [details] [review]
Bug 40771: Fix error in the case of AutoFill

Similar to previous patches we need to ignore limits to return a reserve where it belongs

To test:
 1 - Set sysprefs:
     UseBranchTransferLimits/BranchTransferLimitsType:
         To Enforce based on collection
     HoldsAutoFill: Do
 2 - Administration->Library Transfer limits click (Advanced editor)
 3 - Uncheck Centerville->Fairfield for 'Fiction'
 4 - Find or create a Fiction item at centerville
 5 - Place a hold on the item for a patron to pickup at Centerville
 6 - Check the item in at Centerville
 7 - Switch branch to Fairfield
 8 - Check in the item
 9 - Boom!
     Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
10 - Apply patch, restart all
11 - Check in the item at Fairfield
12 - Correctly transferred to Centerville
Comment 2 Nick Clemens (kidclamp) 2025-12-17 14:35:17 UTC
Created attachment 190586 [details] [review]
Bug 40771: Fix transfer error when not auto filling hold

This patch is another occurence where correcting a reserve transfer requires ignoring limits

To test:
1 - Follow previous test plan
2 - Disable HoldsAutoFill
3 - Set library to Centerville
4 - Check the item in and confirm hold
5 - Set library to Fairfield
6 - Check the item in and confirm transfer
7 - Boom! Same error as before
8 - Apply this patch, restart all
9 - Check item in
10 - Correctly transferred to Centerville
Comment 3 Nick Clemens (kidclamp) 2025-12-17 14:35:37 UTC
Created attachment 190587 [details] [review]
Bug 40771: Fix error in the case of AutoFill

Similar to previous patches we need to ignore limits to return a reserve where it belongs

To test:
 1 - Set sysprefs:
     UseBranchTransferLimits/BranchTransferLimitsType:
         To Enforce based on collection
     HoldsAutoFill: Do
 2 - Administration->Library Transfer limits click (Advanced editor)
 3 - Uncheck Centerville->Fairfield for 'Fiction'
 4 - Find or create a Fiction item at centerville
 5 - Place a hold on the item for a patron to pickup at Centerville
 6 - Check the item in at Centerville
 7 - Switch branch to Fairfield
 8 - Check in the item
 9 - Boom!
     Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
10 - Apply patch, restart all
11 - Check in the item at Fairfield
12 - Correctly transferred to Centerville

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens (kidclamp) 2025-12-17 14:35:39 UTC
Created attachment 190588 [details] [review]
Bug 40771: Fix transfer error when not auto filling hold

This patch is another occurence where correcting a reserve transfer requires ignoring limits

To test:
1 - Follow previous test plan
2 - Disable HoldsAutoFill
3 - Set library to Centerville
4 - Check the item in and confirm hold
5 - Set library to Fairfield
6 - Check the item in and confirm transfer
7 - Boom! Same error as before
8 - Apply this patch, restart all
9 - Check item in
10 - Correctly transferred to Centerville

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2025-12-17 14:35:54 UTC
Trivial, self SO