Bug 23117 - additem.pl crashes on nonexistent biblionumber
Summary: additem.pl crashes on nonexistent biblionumber
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-13 16:05 UTC by Jonathan Druart
Modified: 2020-06-04 20:32 UTC (History)
1 user (show)

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


Attachments
Bug 23117: Shortcut additem.pl on nonexistent biblionumber (2.85 KB, patch)
2019-06-13 16:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23117: Shortcut additem.pl on nonexistent biblionumber (2.89 KB, patch)
2019-06-14 18:18 UTC, Bin Wen
Details | Diff | Splinter Review
Bug 23117: Shortcut additem.pl on nonexistent biblionumber (2.95 KB, patch)
2019-06-14 18:25 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 Jonathan Druart 2019-06-13 16:05:20 UTC
Can't call method "fields" on an undefined value at /home/vagrant/kohaclone/cataloguing/additem.pl line 736.
Comment 1 Jonathan Druart 2019-06-13 16:09:51 UTC
Created attachment 90580 [details] [review]
Bug 23117: Shortcut additem.pl on nonexistent biblionumber

To prevent additem.pl to crash when called with a nonexistent
biblionumber we are here implementing the blocking_error.inc trick to
display a friendly message instead.

Can't call method "fields" on an undefined value at
/home/vagrant/kohaclone/cataloguing/additem.pl line 736.

Test plan:
hit
/cataloguing/additem.pl?biblionumber=
/cataloguing/additem.pl?biblionumber=424242
You will get a friendly "Bibliographic record not found." message,
instead of a 500
Comment 2 Bin Wen 2019-06-14 18:18:46 UTC
Created attachment 90618 [details] [review]
Bug 23117: Shortcut additem.pl on nonexistent biblionumber

To prevent additem.pl to crash when called with a nonexistent
biblionumber we are here implementing the blocking_error.inc trick to
display a friendly message instead.

Can't call method "fields" on an undefined value at
/home/vagrant/kohaclone/cataloguing/additem.pl line 736.

Test plan:
hit
/cataloguing/additem.pl?biblionumber=
/cataloguing/additem.pl?biblionumber=424242
You will get a friendly "Bibliographic record not found." message,
instead of a 500

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 3 Nick Clemens (kidclamp) 2019-06-14 18:25:31 UTC
Created attachment 90623 [details] [review]
Bug 23117: Shortcut additem.pl on nonexistent biblionumber

To prevent additem.pl to crash when called with a nonexistent
biblionumber we are here implementing the blocking_error.inc trick to
display a friendly message instead.

Can't call method "fields" on an undefined value at
/home/vagrant/kohaclone/cataloguing/additem.pl line 736.

Test plan:
hit
/cataloguing/additem.pl?biblionumber=
/cataloguing/additem.pl?biblionumber=424242
You will get a friendly "Bibliographic record not found." message,
instead of a 500

Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Martin Renvoize (ashimema) 2019-06-15 07:03:05 UTC
Nice work!

Pushed to master for 19.11.00
Comment 5 Fridolin Somers 2019-06-20 12:49:33 UTC
Pushed to 19.05.x for 19.05.01