Bug 30630 - Checking in a waiting hold at another branch when HoldsAutoFill is enabled causes errors
Summary: Checking in a waiting hold at another branch when HoldsAutoFill is enabled ca...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23070
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-27 15:28 UTC by Nick Clemens (kidclamp)
Modified: 2023-06-08 22:26 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact: Martin Renvoize
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.06,21.05.16
Circulation function:


Attachments
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON (1.51 KB, patch)
2022-04-28 07:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON (1.55 KB, patch)
2022-04-28 09:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON (1.61 KB, patch)
2022-04-28 10:14 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) 2022-04-27 15:28:09 UTC

    
Comment 1 Nick Clemens (kidclamp) 2022-04-27 15:31:27 UTC
To recreate:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item, get an error:
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
6- This causes lingering issues because the hold is now in-transit but has no itemnumber

Root seems to be in circ/returns.pl:
477         ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_    id}, $desk_id );


RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item
Comment 2 Jonathan Druart 2022-04-28 07:40:40 UTC
yes, *should* :)
Comment 3 Jonathan Druart 2022-04-28 07:46:44 UTC
Created attachment 134203 [details] [review]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds
Comment 4 David Nind 2022-04-28 09:21:19 UTC
Created attachment 134208 [details] [review]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Nick Clemens (kidclamp) 2022-04-28 10:14:54 UTC
Created attachment 134218 [details] [review]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Fridolin Somers 2022-04-28 20:51:07 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 7 Kyle M Hall (khall) 2022-05-06 17:49:45 UTC
Pushed to 21.11.x for 21.11.06
Comment 8 Victor Grousset/tuxayo 2022-06-22 23:32:48 UTC
Backported: Pushed to 21.05.x branch for 21.05.16
Comment 9 Martin Renvoize (ashimema) 2022-06-23 13:37:52 UTC
Bugfix, no workflow of visual changes.. No documentation updates required.