@@ -, +, @@ --- C4/Circulation.pm | 2 ++ circ/circulation.pl | 1 - circ/renew.pl | 1 - circ/returns.pl | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -153,6 +153,7 @@ Will do some manipulation of the barcode for systems that deliver a barcode to circulation.pl that differs from the barcode stored for the item. For proper functioning of this filter, calling the function on the correct barcode string (items.barcode) should return an unaltered barcode. +Barcode is going to be automatically trimmed of leading/trailing whitespaces. The optional $filter argument is to allow for testing or explicit behavior that ignores the System Pref. Valid values are the same as the @@ -166,6 +167,7 @@ System Pref options. sub barcodedecode { my ($barcode, $filter) = @_; my $branch = C4::Context::mybranch(); + $barcode =~ s/^\s+|\s+$//g; $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter; Koha::Plugins->call('item_barcode_transform', \$barcode ); $filter or return $barcode; # ensure filter is defined, else return untouched barcode --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -159,7 +159,6 @@ if (C4::Context->preference("DisplayClearScreenButton")) { } for my $barcode ( @$barcodes ) { - $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode( $barcode ) if $barcode; } --- a/circ/renew.pl +++ a/circ/renew.pl @@ -43,7 +43,6 @@ my $schema = Koha::Database->new()->schema(); my $barcode = $cgi->param('barcode') // ''; my $unseen = $cgi->param('unseen') || 0; -$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae $barcode = barcodedecode($barcode) if $barcode; my $override_limit = $cgi->param('override_limit'); my $override_holds = $cgi->param('override_holds'); --- a/circ/returns.pl +++ a/circ/returns.pl @@ -119,7 +119,6 @@ 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 $barcode; ###################### --