From d8eb572eeeffcc35cb9a09534eddd802a6871fb6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Sat, 23 Mar 2019 11:44:53 +0000 Subject: [PATCH] Bug 22288: Correct item search in batchMod by barcode file To test: 1 - Have a list of barcodes that exist in your catalog 2 - Go to Tools->Batch item modification 3 - Attempt to modify items using the list 4 - Get an error page 5 - Apply patch 6 - Repeat 7 - Modification should work correctly Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit 192e3baa75f16891582244595fe305292b886dda) Signed-off-by: Martin Renvoize --- tools/batchMod.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index afb2d293b7..b540c12f90 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -246,9 +246,9 @@ if ($op eq "show"){ @contentlist = uniq @contentlist; if ($filecontent eq 'barcode_file') { - my $existing_items = Koha::Items->search({ itemnumber => \@contentlist }); + my $existing_items = Koha::Items->search({ barcode => \@contentlist }); @itemnumbers = $existing_items->get_column('itemnumber'); - my %exists = map {$_=>1} @{$existing_items->get_column('barcode')}; + my %exists = map {$_=>1} $existing_items->get_column('barcode'); @notfoundbarcodes = grep { !$exists{$_} } @contentlist; } elsif ( $filecontent eq 'itemid_file') { -- 2.39.5