From 427efec51622b9564f77939171d8194d47a86afd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 30 Jan 2013 12:44:32 -0500 Subject: [PATCH] Bug 9509 - batchMod.pl does not ensure each barcode is unique MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test plan: 1) Browse to Tools › Batch item deletion 2) Enter a list of barcodes, make sure you have at least one barcode listed more than once 3) Click continue 4) Verify the duplicated barcode shows up multiple times in the table 5) Apply patch 6) Refresh the page 7) Verify each barcode now displays only once Signed-off-by: Liz Rea verified bug and fix - both good. Nice test plan, thanks! Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov Signed-off-by: Chris Cormack --- tools/batchMod.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 5469496302..b361a0b07d 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -34,6 +34,7 @@ use C4::ClassSource; use C4::Dates; use C4::Debug; use MARC::File::XML; +use List::MoreUtils qw/uniq/; my $input = new CGI; my $dbh = C4::Context->dbh; @@ -228,7 +229,7 @@ if ($op eq "show"){ } } else { if ( my $list=$input->param('barcodelist')){ - push my @barcodelist, split(/\s\n/, $list); + push my @barcodelist, uniq( split(/\s\n/, $list) ); foreach my $barcode (@barcodelist) { -- 2.39.5