Bugzilla – Attachment 46001 Details for
Bug 14015
Checkout: Fix software error if barcode '0' is given
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14015 - Checkout: Fix software error if barcode '0' is given
Bug-14015---Checkout-Fix-software-error-if-barcode.patch (text/plain), 1.55 KB, created by
Jonathan Druart
on 2015-12-28 12:07:54 UTC
(
hide
)
Description:
Bug 14015 - Checkout: Fix software error if barcode '0' is given
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-28 12:07:54 UTC
Size:
1.55 KB
patch
obsolete
>From f686591aaf06857380ed2f5bff57f428ee0f0418 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Mon, 28 Dec 2015 12:15:18 +0100 >Subject: [PATCH] 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> >--- > circ/circulation.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 3748d97..6ba294b 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -88,7 +88,9 @@ if (!C4::Context->userenv && !$branch){ > } > > my $barcodes = []; >-if ( my $barcode = $query->param('barcode') ) { >+my $barcode = $query->param('barcode'); >+# Barcode given by user could be '0' >+if ( $barcode || $barcode eq '0' ) { > $barcodes = [ $barcode ]; > } else { > my $filefh = $query->upload('uploadfile'); >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14015
:
45660
|
45661
|
45873
|
45999
|
46000
| 46001