Bug 39750

Summary: Wrong transfer breaking check in when using library transfer limits
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: major    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 28294    
Bug Blocks:    
Attachments: Bug 39750: Ignore limits when updating WrongTransfer
Bug 39750: Ignore limits when updating WrongTransfer
Bug 39750: Ignore limits when updating WrongTransfer

Description Nick Clemens (kidclamp) 2025-04-25 16:25:29 UTC
To recreate:
1 - Enable  UseBranchTransferLimits based on 'Collection code'
2 - Disable transfers for FIC from:
    CPL -> FFL
    CPL -> IPT
    FFL -> CPL
    FFL -> IPT
    IPT -> CPL
    IPT -> FFL
3 - Set library to IPT
4 - Checkin an FFL item
5 - It generates a transfer home
6 - Set library to CPL
7 - Check the item in
8 - 500 error, and in logs:
    ==> /var/log/koha/kohadev/plack-error.log <==
Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
Comment 1 Nick Clemens (kidclamp) 2025-04-25 16:27:58 UTC
Created attachment 181547 [details] [review]
Bug 39750: Ignore limits when updating WrongTransfer

This patch ignores limits when updating a wrong transfer to ensure we can return a book
home when checked in at the wrong branch

To test:
1 - Enable  UseBranchTransferLimits based on 'Collection code'
2 - Disable transfers for FIC from:
    CPL -> FFL
    CPL -> IPT
    FFL -> CPL
    FFL -> IPT
    IPT -> CPL
    IPT -> FFL
3 - Set library to IPT
4 - Checkin an FFL item
5 - It generates a transfer home
6 - Set library to CPL
7 - Check the item in
8 - 500 error, and in logs:
    ==> /var/log/koha/kohadev/plack-error.log <==
Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
9 - Apply patch, restart all
10 - Check item in again
11 - Success! Transfer updated
Comment 2 Roman Dolny 2025-04-25 21:11:04 UTC
Created attachment 181557 [details] [review]
Bug 39750: Ignore limits when updating WrongTransfer

This patch ignores limits when updating a wrong transfer to ensure we can return a book
home when checked in at the wrong branch

To test:
1 - Enable  UseBranchTransferLimits based on 'Collection code'
2 - Disable transfers for FIC from:
    CPL -> FFL
    CPL -> IPT
    FFL -> CPL
    FFL -> IPT
    IPT -> CPL
    IPT -> FFL
3 - Set library to IPT
4 - Checkin an FFL item
5 - It generates a transfer home
6 - Set library to CPL
7 - Check the item in
8 - 500 error, and in logs:
    ==> /var/log/koha/kohadev/plack-error.log <==
Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
9 - Apply patch, restart all
10 - Check item in again
11 - Success! Transfer updated

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Martin Renvoize (ashimema) 2025-04-28 06:45:48 UTC
Created attachment 181575 [details] [review]
Bug 39750: Ignore limits when updating WrongTransfer

This patch ignores limits when updating a wrong transfer to ensure we can return a book
home when checked in at the wrong branch

To test:
1 - Enable  UseBranchTransferLimits based on 'Collection code'
2 - Disable transfers for FIC from:
    CPL -> FFL
    CPL -> IPT
    FFL -> CPL
    FFL -> IPT
    IPT -> CPL
    IPT -> FFL
3 - Set library to IPT
4 - Checkin an FFL item
5 - It generates a transfer home
6 - Set library to CPL
7 - Check the item in
8 - 500 error, and in logs:
    ==> /var/log/koha/kohadev/plack-error.log <==
Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
9 - Apply patch, restart all
10 - Check item in again
11 - Success! Transfer updated

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 4 Katrin Fischer 2025-04-28 16:54:58 UTC
Pushed for 25.05!

Well done everyone, thank you!