Bug 29840

Summary: opac-reserve explodes if invalid biblionumber is passed
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: andrewfh, kyle, tomascohen, victor
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29562
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.11
Attachments: Bug 29840: Deal with non-existing biblionumber in opac-reserve
Bug 29840: Deal with non-existing biblionumber in opac-reserve
Bug 29840: Deal with non-existing biblionumber in opac-reserve

Description Jonathan Druart 2022-01-10 13:02:28 UTC
An error message should be displayed instead.

Can't call method "holds" on an undefined value at /kohadevbox/koha/opac/opac-reserve.pl line 172
Comment 1 Jonathan Druart 2022-01-10 13:04:34 UTC
Created attachment 129256 [details] [review]
Bug 29840: Deal with non-existing biblionumber in opac-reserve

We should not explode if the biblionumber passed in not in DB.

Test plan:
Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424
and notice the error message.

Without this patch you got
Can't call method "holds" on an undefined value at /kohadevbox/koha/opac/opac-reserve.pl line 172
Comment 2 Owen Leonard 2022-01-11 18:19:18 UTC
Created attachment 129320 [details] [review]
Bug 29840: Deal with non-existing biblionumber in opac-reserve

We should not explode if the biblionumber passed in not in DB.

Test plan:
Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424
and notice the error message.

Without this patch you got
Can't call method "holds" on an undefined value at
/kohadevbox/koha/opac/opac-reserve.pl line 172

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Tomás Cohen Arazi 2022-01-14 14:19:55 UTC
Created attachment 129483 [details] [review]
Bug 29840: Deal with non-existing biblionumber in opac-reserve

We should not explode if the biblionumber passed in not in DB.

Test plan:
Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424
and notice the error message.

Without this patch you got
Can't call method "holds" on an undefined value at
/kohadevbox/koha/opac/opac-reserve.pl line 172

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Fridolin Somers 2022-01-22 07:41:03 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 5 Kyle M Hall 2022-02-07 11:53:47 UTC
Pushed to 21.11.x for 21.11.03
Comment 6 Andrew Fuerste-Henry 2022-02-16 21:30:09 UTC
Pushed to 21.05.x for 21.05.11
Comment 7 Victor Grousset/tuxayo 2022-02-21 08:57:50 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.