From e06c926972be1aead84a9671d9643f5937948cb0 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 15 Apr 2015 12:33:29 -0400 Subject: [PATCH] Bug 14001 - Inventory tool is not plack friendly After receiving an error while attempt a simple inventory run, Line 297 was changed from: ...$_->... to ...$item->... since the loop variable is $item. TEST PLAN --------- 1) installed the kohadevbox (https://github.com/digibib/kohadevbox) or have your staff client plackified 2) Log in to plack staff client 3) Add one item via z39.50, setting barcode to a known value (BARCODE1) 4) Wait for the reindex 5) Home -> Tools -> Inventory/Stocktaking 6) Browse for a file with the barcode in it 7) Set the library dropdown to the library branch of the added item. 8) Click 'Submit' -- *kaboom* Plack barfed on line 297. 9) Repeat steps 5-7 10) Check 'Compare barcodes list to results:' 11) Click 'Submit' -- *kaboom* Plack barfed on line 250. 12) apply the patch on the kohadevbox 13) re-attempt process (steps 5-11) -- success! 14) run koha qa test tools --- tools/inventory.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index b8cc31d..64c38bc 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -247,7 +247,7 @@ if ( $compareinv2barcd ) { my $dls = output_pref( { dt => dt_from_string( $datelastseen ), dateformat => 'iso' } ); foreach my $item ( @$inventorylist ) { - my $cdls = output_pref( { dt => dt_from_string( $_->{datelastseen} ), + my $cdls = output_pref( { dt => dt_from_string( $item->{datelastseen} ), dateformat => 'iso' } ); if ( $cdls lt $dls ) { $item->{problem} = 'missingitem'; @@ -294,7 +294,7 @@ foreach my $item ( @scanned_items ) { } # Modify date last seen for scanned items - ModDateLastSeen($_->{'itemnumber'}); + ModDateLastSeen($item->{'itemnumber'}); $moddatecount++; } -- 1.7.10.4