[Koha-patches] [PATCH] Bug 4316: Fixes leading and trailing spaces in barcode for cki.

Garry Collum gcollum at gmail.com
Sat Mar 13 14:06:50 CET 2010


Copies the regexp from circulation.pl to strip leading and trailing spaces from barcodes to returns.pl.
---
 circ/returns.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/circ/returns.pl b/circ/returns.pl
index adec8f6..9e79bbe 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -105,6 +105,7 @@ foreach ( $query->param ) {
     $counter++;
 
     # decode barcode    ## Didn't we already decode them before passing them back last time??
+    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
     $barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
 
     ######################
@@ -184,6 +185,7 @@ if ($dotransfer){
 
 # actually return book and prepare item table.....
 if ($barcode) {
+    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
     $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
     $itemnumber = GetItemnumberFromBarcode($barcode);
 
-- 
1.5.6.5




More information about the Koha-patches mailing list