Bug 14015 - Checkout: Fix software error if barcode '0' is given
authorMarc Véron <veron@veron.ch>
Mon, 28 Dec 2015 11:15:18 +0000 (12:15 +0100)
committerJulian Maurice <julian.maurice@biblibre.com>
Fri, 29 Jan 2016 11:13:31 +0000 (12:13 +0100)
commit80c042cf41932e3c6d9d7d70365e9fd26538f80e
tree47839bbb0d9979f80182546a6389acfbb9a5f768
parent64eb1f88ea741ca06b0a17bf4186ad25c7487f81
Bug 14015 - Checkout: Fix software error if barcode '0' is given

To reproduce the bug:
- Go to Home > Circulation > Checkouts > [a patron]
- Enter 0 (zero) in barcode field and hit Enter

Result:
Software error
  Can't use string ("1") as a HASH ref while "strict refs" in use
  at /usr/share/kohaclone/circ/circulation.pl line 473

To test:
- Apply patch
- Repeat steps above
- Verify that the sofware error is gone and that you get a
  message as with other invalid barcodes.
- Test with other values: '00', '000', existing barcode,
  and a barcode that does not exist
- Test with empty barcode (for printing slip)
- Search for regressions

This patch implements Jonathan's solution (see comment #15)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9afc8e96f3d173a3998cbec2a4ad7ceaf506e49a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
circ/circulation.pl