Bug 28644 - Can't call method "borrowernumber" on an undefined value at C4/Reserves.pm line 607
Summary: Can't call method "borrowernumber" on an undefined value at C4/Reserves.pm li...
Status: Pushed to oldoldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Marcel de Rooy
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-01 14:08 UTC by Marcel de Rooy
Modified: 2021-09-08 02:29 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.02,20.11.09,20.05.15,19.11.22
Circulation function:


Attachments
Bug 28644: Fix calling borrowernumber on undefined value (2.04 KB, patch)
2021-07-01 14:18 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 28644: Fix calling borrowernumber on undefined value (2.06 KB, patch)
2021-07-09 12:20 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28644: [19.11.x] Fix calling borrowernumber on undefined value (2.19 KB, patch)
2021-09-07 10:59 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 Marcel de Rooy 2021-07-01 14:08:44 UTC
Got this one under 19.11 on line 521
Looks like someone tried to cancel an already cancelled hold from the opac (in the user menu).
Trivial fix.
Comment 1 Marcel de Rooy 2021-07-01 14:18:55 UTC
Created attachment 122518 [details] [review]
Bug 28644: Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2021-07-01 14:19:21 UTC
Self signoff; too trivial to wait for.
Comment 3 Nick Clemens (kidclamp) 2021-07-09 12:20:28 UTC
Created attachment 122735 [details] [review]
Bug 28644: Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Jonathan Druart 2021-07-12 13:49:58 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall (khall) 2021-07-16 12:23:23 UTC
Pushed to 21.05.x for 21.05.02
Comment 6 Fridolin Somers 2021-08-02 21:34:18 UTC
Pushed to 20.11.x for 20.11.09
Comment 7 Victor Grousset/tuxayo 2021-08-16 18:31:09 UTC
Backported: Pushed to 20.05.x branch for 20.05.15
Comment 8 Wainui Witika-Park 2021-08-17 00:31:03 UTC
Should this be backported to 19.11.x for 19.11.21?

Or if it contains string changes, backported to 19.11.22? As we are currently in a string freeze.
Comment 9 Wainui Witika-Park 2021-09-07 01:46:08 UTC
Should this be backported to 19.11.x for 19.11.22?
Comment 10 Nick Clemens (kidclamp) 2021-09-07 10:59:36 UTC
Created attachment 124571 [details] [review]
Bug 28644: [19.11.x] Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Wainui Witika-Park 2021-09-08 02:29:59 UTC
Backported to 19.11.x for 19.11.22