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>
This commit is contained in:
Marcel de Rooy 2019-05-29 13:46:15 +00:00 committed by Martin Renvoize
parent b40e58343e
commit 851d41ab6b
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

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