Bug 22675 - SCO broken on invalid barcodes
Summary: SCO broken on invalid barcodes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 21206
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-09 18:57 UTC by Tomás Cohen Arazi
Modified: 2020-01-06 20:14 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:
19.05.00


Attachments
Bug 22675: Fix SCO behaviour on non-existent barcodes (1.50 KB, patch)
2019-04-09 19:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22675: Fix SCO behaviour on non-existent barcodes (1.54 KB, patch)
2019-04-09 20:54 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22675: Fix SCO behaviour on non-existent barcodes (1.54 KB, patch)
2019-04-09 20:54 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22675: Fix SCO behaviour on non-existent barcodes (1.60 KB, patch)
2019-04-10 07:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-04-09 18:57:51 UTC
The SCO tool breaks when a non-existent barcode is introduced
To reproduce:
- Log into SCO
- Type any barcode that doesn't exist on the DB, hit enter
=> FAIL: Explodes
Comment 1 Tomás Cohen Arazi 2019-04-09 19:01:27 UTC
Created attachment 87672 [details] [review]
Bug 22675: Fix SCO behaviour on non-existent barcodes

Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.

To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D
Comment 2 Liz Rea 2019-04-09 20:54:10 UTC
Created attachment 87684 [details] [review]
Bug 22675: Fix SCO behaviour on non-existent barcodes

Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.

To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
100% that used to explode, and now does not. Excellent.
Comment 3 Liz Rea 2019-04-09 20:54:49 UTC
Created attachment 87685 [details] [review]
Bug 22675: Fix SCO behaviour on non-existent barcodes

Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.

To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 4 Liz Rea 2019-04-09 20:55:19 UTC
I laughed so hard at myself I scared my dog.
Comment 5 Katrin Fischer 2019-04-10 07:20:45 UTC
Created attachment 87702 [details] [review]
Bug 22675: Fix SCO behaviour on non-existent barcodes

Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.

To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Nick Clemens 2019-04-10 20:15:37 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-04-15 11:29:11 UTC
Bug in enhancement not in 18.11.x series