Browse Source

Bug 23006: Cannot use inventory with barcodes containing special chars

If a barcode contains special characters like $, the regex in inventory
does no longer work.
This fix (as suggested by Jonathan) replaces the regex by a eq compare.

Test plan:
Pick one barcode and add a $ somewhere in the middle, say 123$456.
Include this barcode in a barcode file for inventory.
Run inventory on that file and verify that barcode was read and datelastseen
was updated. The barcode should not be reported as missing (not scanned).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Marcel de Rooy 5 years ago
committed by Martin Renvoize
parent
commit
851d41ab6b
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      tools/inventory.pl

2
tools/inventory.pl

@ -328,7 +328,7 @@ if ( $compareinv2barcd ) {
my $barcode = $item->{barcode};
if( !$barcode ) {
$item->{problems}->{no_barcode} = 1;
} elsif ( grep /^$barcode$/, @scanned_barcodes ) {
} elsif ( grep { $_ eq $barcode } @scanned_barcodes ) {
next;
} else {
$item->{problems}->{not_scanned} = 1;

Loading…
Cancel
Save