Bug 20499 - Checkout of bad barcode: Internal Server Error
Summary: Checkout of bad barcode: Internal Server Error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Mark Tompsett
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 19943
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-29 18:30 UTC by Mark Tompsett
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20499: Unit Test to prove the problem (1.60 KB, patch)
2018-03-29 18:46 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20499: Fix the Internal Server Error (1.03 KB, patch)
2018-03-29 18:49 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20499: Fix the Internal Server Error (1.57 KB, patch)
2018-03-29 19:03 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20499: Unit Test to prove the problem (1.68 KB, patch)
2018-04-12 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20499: Fix the Internal Server Error (1.65 KB, patch)
2018-04-12 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20499: just check if GetItem returns something is enough (898 bytes, patch)
2018-04-12 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20499: Unit Test to prove the problem (1.77 KB, patch)
2018-04-13 08:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20499: Fix the Internal Server Error (1.73 KB, patch)
2018-04-13 08:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20499: just check if GetItem returns something is enough (989 bytes, patch)
2018-04-13 08:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2018-03-29 18:30:58 UTC
There is no error checking on whether the barcode was found. Add some to prevent this internal server error.

Can't call method "biblioitem" on an undefined value at /home/vagrant/kohaclone/C4/Circulation.pm line 673.
Comment 1 Mark Tompsett 2018-03-29 18:46:50 UTC
Created attachment 73439 [details] [review]
Bug 20499: Unit Test to prove the problem

TEST PLAN
---------
1) apply this patch
2) prove t/db_dependent/Circulation.t
   -- horrible death.
3) apply next path
4) prove t/db_dependent/Circulation.t
   -- passes.
5) run koha qa test tools
Comment 2 Mark Tompsett 2018-03-29 18:49:42 UTC
Created attachment 73440 [details] [review]
Bug 20499: Fix the Internal Server Error

TEST PLAN
---------
See comment #1

Applying the test without the patch: messy.
Applyin both patches: smooth.
Run koha qa test tools
Comment 3 Mark Tompsett 2018-03-29 18:51:40 UTC
The location of the test was chosen, because it is where the first occurrence of CanBookBeIssued is. Feel free to move it elsewhere if needed. But the fix is the fix. :)
Comment 4 Mark Tompsett 2018-03-29 19:03:24 UTC
Created attachment 73442 [details] [review]
Bug 20499: Fix the Internal Server Error

TEST PLAN
---------
See comment #1

Applying the test without the patch: messy.
Applyin both patches: smooth.
Run koha qa test tools
Comment 5 Jonathan Druart 2018-04-12 15:28:42 UTC
Caused by 
  commit 6183c0e6a910663fec02bdba66d05f173310f562
  Bug 19943: Koha::Biblio - Replace GetBiblioItemData with Koha::Biblio->biblioitem
Comment 6 Jonathan Druart 2018-04-12 15:32:00 UTC
Created attachment 74107 [details] [review]
Bug 20499: Unit Test to prove the problem

TEST PLAN
---------
1) apply this patch
2) prove t/db_dependent/Circulation.t
   -- horrible death.
3) apply next path
4) prove t/db_dependent/Circulation.t
   -- passes.
5) run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2018-04-12 15:32:03 UTC
Created attachment 74108 [details] [review]
Bug 20499: Fix the Internal Server Error

TEST PLAN
---------
See comment #1

Applying the test without the patch: messy.
Applyin both patches: smooth.
Run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2018-04-12 15:32:06 UTC
Created attachment 74109 [details] [review]
Bug 20499: just check if GetItem returns something is enough

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Marcel de Rooy 2018-04-13 08:06:53 UTC
QA: Looking here
Comment 10 Marcel de Rooy 2018-04-13 08:09:10 UTC
'"KohaIsAwesome" is not a valid barcode.
Mark: Formally, this is an assumption :)
Comment 11 Marcel de Rooy 2018-04-13 08:16:00 UTC
Created attachment 74144 [details] [review]
Bug 20499: Unit Test to prove the problem

TEST PLAN
---------
1) apply this patch
2) prove t/db_dependent/Circulation.t
   -- horrible death.
3) apply next path
4) prove t/db_dependent/Circulation.t
   -- passes.
5) run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Marcel de Rooy 2018-04-13 08:16:05 UTC
Created attachment 74145 [details] [review]
Bug 20499: Fix the Internal Server Error

TEST PLAN
---------
See comment #1

Applying the test without the patch: messy.
Applyin both patches: smooth.
Run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2018-04-13 08:16:09 UTC
Created attachment 74146 [details] [review]
Bug 20499: just check if GetItem returns something is enough

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Jonathan Druart 2018-04-13 16:41:54 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 15 Nick Clemens 2018-05-21 17:36:07 UTC
Dependency not in stable