Bug 29840 - opac-reserve explodes if invalid biblionumber is passed
Summary: opac-reserve explodes if invalid biblionumber is passed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-10 13:02 UTC by Jonathan Druart
Modified: 2022-12-12 21:23 UTC (History)
4 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:
22.05.00,21.11.03,21.05.11


Attachments
Bug 29840: Deal with non-existing biblionumber in opac-reserve (1.03 KB, patch)
2022-01-10 13:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29840: Deal with non-existing biblionumber in opac-reserve (1.07 KB, patch)
2022-01-11 18:19 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29840: Deal with non-existing biblionumber in opac-reserve (1.13 KB, patch)
2022-01-14 14:19 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.